Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 poker
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
spazobo




PostPosted: Fri Jun 04, 2004 11:33 am   Post subject: poker

hi there....i need help in making a poker game..this is what i have so far..the positions are wrong but the basis is right..i need to know how to make the cards show up on the screen

var suit : int
var card1 : int
var card2 : int
var card3 : int
var card4 : int


proc clubs (loc : int)

for count : 1 .. 10
for x : 60 .. 540 by 100
drawbox (x, 190, x + 100, 290, 7)
drawfillbox (x + 1, 191, x + 99, 289, 0)
end for

randint (card1, 1, 13)

if card1 = 1 then
Pic.ScreenLoad ("H:/twoc.jpg", loc, 100, 0)

elsif card1 = 2 then
Pic.ScreenLoad ("H:/threec.jpg", 80, 100, 0)

elsif card1 = 3 then
Pic.ScreenLoad ("H:/fourc.jpg", 80, 100, 0)

elsif card1 = 4 then
Pic.ScreenLoad ("H:/fivec.jpg", 80, 100, 0)

elsif card1 = 5 then
Pic.ScreenLoad ("H:/sixc.jpg", 80, 100, 0)

elsif card1 = 6 then
Pic.ScreenLoad ("H:/sevenc.jpg", 80, 100, 0)

elsif card1 = 7 then
Pic.ScreenLoad ("H:/eightc.jpg", 80, 100, 0)

elsif card1 = 8 then
Pic.ScreenLoad ("H:/ninec.jpg", 80, 100, 0)

elsif card1 = 9 then
Pic.ScreenLoad ("H:/tenc.jpg", 80, 100, 0)

elsif card1 = 10 then
Pic.ScreenLoad ("H:/jackc.jpg", 80, 100, 0)

elsif card1 = 11 then
Pic.ScreenLoad ("H:/queenc.jpg", 80, 100, 0)

elsif card1 = 12 then
Pic.ScreenLoad ("H:/kingc.jpg", 80, 100, 0)

elsif card1 = 13 then
Pic.ScreenLoad ("H:/acec.jpg", 80, 100, 0)
delay (20)
end if
end for
end clubs

proc diamonds

for count : 1 .. 500
for x : 60 .. 540 by 100
drawbox (x, 190, x + 100, 290, 7)
drawfillbox (x + 101, 191, x + 199, 289, 0)
end for

randint (card2, 1, 13)

if card2 = 1 then
Pic.ScreenLoad ("H:/twod.jpg", 80, 100, 0)

elsif card2 = 2 then
Pic.ScreenLoad ("H:/threed.jpg", 80, 100, 0)

elsif card2 = 3 then
Pic.ScreenLoad ("H:/fourd.jpg", 80, 100, 0)

elsif card2 = 4 then
Pic.ScreenLoad ("H:/fived.jpg", 80, 100, 0)

elsif card2 = 5 then
Pic.ScreenLoad ("H:/sixd.jpg", 80, 100, 0)

elsif card2 = 6 then
Pic.ScreenLoad ("H:/sevend.jpg", 80, 100, 0)

elsif card2 = 7 then
Pic.ScreenLoad ("H:/eightd.jpg", 80, 100, 0)

elsif card2 = 8 then
Pic.ScreenLoad ("H:/nined.jpg", 80, 100, 0)

elsif card2 = 9 then
Pic.ScreenLoad ("H:/tend.jpg", 80, 100, 0)

elsif card2 = 10 then
Pic.ScreenLoad ("H:/jackd.jpg", 80, 100, 0)

elsif card2 = 11 then
Pic.ScreenLoad ("H:/queend.jpg", 80, 100, 0)

elsif card2 = 12 then
Pic.ScreenLoad ("H:/kingd.jpg", 80, 100, 0)

elsif card2 = 13 then
Pic.ScreenLoad ("H:/aced.jpg", 80, 100, 0)
delay (20)
end if
end for
end diamonds

proc hearts

for count : 1 .. 500
for x : 60 .. 540 by 100
drawbox (x, 190, x + 100, 290, 7)
drawfillbox (x + 201, 191, x + 299, 289, 0)
end for

randint (card3, 1, 13)

if card3 = 1 then
Pic.ScreenLoad ("H:/twoh.jpg", 80, 100, 0)

elsif card3 = 2 then
Pic.ScreenLoad ("H:/threeh.jpg", 80, 100, 0)

elsif card3 = 3 then
Pic.ScreenLoad ("H:/fourh.jpg", 80, 100, 0)

elsif card3 = 4 then
Pic.ScreenLoad ("H:/fiveh.jpg", 80, 100, 0)

elsif card3 = 5 then
Pic.ScreenLoad ("H:/sixh.jpg", 80, 100, 0)

elsif card3 = 6 then
Pic.ScreenLoad ("H:/sevenh.jpg", 80, 100, 0)

elsif card3 = 7 then
Pic.ScreenLoad ("H:/eighth.jpg", 80, 100, 0)

elsif card3 = 8 then
Pic.ScreenLoad ("H:/nineh.jpg", 80, 100, 0)

elsif card3 = 9 then
Pic.ScreenLoad ("H:/tenh.jpg", 80, 100, 0)

elsif card3 = 10 then
Pic.ScreenLoad ("H:/jackh.jpg", 80, 100, 0)

elsif card3 = 11 then
Pic.ScreenLoad ("H:/queenh.jpg", 80, 100, 0)

elsif card3 = 12 then
Pic.ScreenLoad ("H:/kingh.jpg", 80, 100, 0)

elsif card3 = 13 then
Pic.ScreenLoad ("H:/aceh.jpg", 80, 100, 0)
delay (20)
end if
end for
end hearts

proc spades

for count : 1 .. 500
for x : 60 .. 540 by 100
drawbox (x, 190, x + 100, 290, 7)
drawfillbox (x + 301, 191, x + 399, 289, 0)
end for

randint (card4, 1, 13)

if card4 = 1 then
Pic.ScreenLoad ("H:/twos.jpg", 80, 100, 0)

elsif card4 = 2 then
Pic.ScreenLoad ("H:/threes.jpg", 80, 100, 0)

elsif card4 = 3 then
Pic.ScreenLoad ("H:/fours.jpg", 80, 100, 0)

elsif card4 = 4 then
Pic.ScreenLoad ("H:/fives.jpg", 80, 100, 0)

elsif card4 = 5 then
Pic.ScreenLoad ("H:/sixs.jpg", 80, 100, 0)

elsif card4 = 6 then
Pic.ScreenLoad ("H:/sevens.jpg", 80, 100, 0)

elsif card4 = 7 then
Pic.ScreenLoad ("H:/eights.jpg", 80, 100, 0)

elsif card4 = 8 then
Pic.ScreenLoad ("H:/nines.jpg", 80, 100, 0)

elsif card4 = 9 then
Pic.ScreenLoad ("H:/tens.jpg", 80, 100, 0)

elsif card4 = 10 then
Pic.ScreenLoad ("H:/jacks.jpg", 80, 100, 0)

elsif card4 = 11 then
Pic.ScreenLoad ("H:/queens.jpg", 80, 100, 0)

elsif card4 = 12 then
Pic.ScreenLoad ("H:/kings.jpg", 80, 100, 0)

elsif card4 = 13 then
Pic.ScreenLoad ("H:/aces.jpg", 80, 100, 0)
delay (20)
end if
end for
end spades

proc select (var loc : int)

for i : 1 .. 5
loc := 50
randint (suit, 1, 4)
if suit = 1 then
clubs (loc)
elsif suit = 2 then
diamonds
elsif suit = 3 then
hearts
elsif suit = 4 then
spades
end if
loc += 100
end for
end select
Sponsor
Sponsor
Sponsor
sponsor
Cervantes




PostPosted: Fri Jun 04, 2004 3:16 pm   Post subject: (No subject)

check the Tidbits and Tricks thread. in the first post, Asian shows us how to load up a lot of pictures (like you are doing here) easily. Smile

if you want to keep going your way, I wouldn't recommend using Pic.ScreenLoad. use Pic.FileNew() to assaign a variable to each of your pictures, then use Pic.Draw() to draw it.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 2 Posts ]
Jump to:   


Style:  
Search: