|
Post by assdgasfgadfgsdfg on Jun 19, 2010 7:32:36 GMT -5
Hi guys! I'm just coding to analize texas hold em games. Here there's the code for create a deck and mix it! I hope it can be useful for someone...!
dim c$(12), s$(3), m$(52), t$(52), i, j, k, r, c
ResizeText(58,53) TextMode(Text_Buffered)
c$(0)="A" : c$(1)="2" : c$(2)="3" : c$(3)="4" : c$(4)="5" : c$(5)="6" : c$(6)="7"
c$(7)="8" : c$(8)="9" : c$(9)="T" : c$(10)="J" : c$(11)="Q" : c$(12)="K"
s$(0)=" Square" : s$(1)=" Hearts" : s$(2)=" Flower" : s$(3)=" Spades"
'Generating the Deck. For i=0 to 12 For k=0 to 3 j=j+1 m$(j)=c$(i)+s$(k) Next Next
Do 'Blending the Deck. For i=1 to 52 A: j=rnd()%52+1 if t$(j)="" then t$(j)=m$(i) else goto A endif next 'Now the starting Dek become the Blending Deck m$=t$ for i=1 to 52 if i<10 then printr " " + i + ": " + t$(i) else printr i + ": " + t$(i) endif t$(i)="" next c=c+1 : locate 22,0 : print "Step n.: " + c DrawText() Sleep(500) cls
Loop
I know that it can be optimized.. I'm just a beginner =)
|
|
|
Post by shadow008 on Jun 19, 2010 10:17:02 GMT -5
Not bad. Now learn the sprite engine, make sprites to look like the cards, and have your self a poker game XD
|
|
|
Post by DJLinux on Jun 21, 2010 2:43:24 GMT -5
|
|
|
Post by assdgasfgadfgsdfg on Jun 24, 2010 6:18:56 GMT -5
Sure, but i think i'm not smart enough at the moment =) Thank you djlinux
|
|
|
Post by Wayne Rayner on Jun 24, 2010 9:01:26 GMT -5
Give it a go....
You can actually surprise yourself how much you know. I mean thats a decent program you made and turning it into a game would be quite good.
Give it a go it's simple. If you don't know something check documentation and then if you're still stuck post the question here. I'm pretty sure we could answer your questions.
so again just give it a go
|
|
|
Post by assdgasfgadfgsdfg on Jun 24, 2010 16:26:01 GMT -5
Thank you for your encouragement My purpose is not exactly to create a game. I thought I could create a bot that surely i'll use inside free games without real money ;D In the following version there should be a mechanism to record all hands and evaluate chances to win.. Now I'm starting with the scoring system and the demonstration of probabilities For example a pair preflop has a percentage of about 6% and i test it with this code: dim c$(12), s$(3), m$(52), t$(52), i, j, k#, r#, c, t, h
ResizeText(50,45) TextMode(Text_Buffered)
c$(0)="A" : c$(1)="2" : c$(2)="3" : c$(3)="4" : c$(4)="5" : c$(5)="6" : c$(6)="7"
c$(7)="8" : c$(8)="9" : c$(9)="10" : c$(10)="J" : c$(11)="Q" : c$(12)="K"
s$(0)=" Square" : s$(1)=" Heart" : s$(2)=" Flower" : s$(3)=" Spades"
'Generating the Deck. For i=0 to 12 For k#=0 to 3 j=j+1 m$(j)=c$(i)+s$(k#) Next Next
'Blending the Deck. For i=1 to 52 A: j=rnd()%52+1 if t$(j)="" then t$(j)=m$(i) else goto A endif next
Input "Pair Pre-Flop Analysys - Steps: ", k#
Printr "" Print "Total Steps: "
For i=1 to k# B: j=rnd()%52+1 : h=rnd()%52+1 if j<>h then if mid$(t$(j),1,1)=mid$(t$(h),1,1) then r#=r#+1 endif else goto B endif
'Re-Blending the Deck. For c=1 to 52 t$(c)="" Next 'Re-Building the Deck. For t=1 to 52 C: j=rnd()%52+1 if t$(j)="" then t$(j)=m$(t) else goto C endif Next
m$=t$
locate 14,2 : print i drawtext()
Next Printr "" Printr "Pair in hand: " + r# Printr "Average Pair: " + (r#/k#*100) + "%"
DrawText()
|
|
|
Post by shadow008 on Jun 29, 2010 22:43:49 GMT -5
Actually, thats not half bad. If you know your statistics you have the advantage
|
|
|
Post by assdgasfgadfgsdfg on Aug 27, 2010 13:10:00 GMT -5
|
|
|
Post by shadow008 on Nov 30, 2010 15:20:19 GMT -5
@_@ i never even realized this was still being updated. Very nice update : )
|
|
|
Post by assdgasfgadfgsdfg on Dec 20, 2010 7:57:40 GMT -5
Yeah shadow008 =) Before i started studying at university (computer science xD) I had more time to test my skill on this project.
I edit the updating message cause i didn't want to be "invasive" in the forum =)
If you all guys have any ideas you're welcome to tell me =D
|
|