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

Username:   Password: 
 RegisterRegister   
 draw die
Index -> Programming, Turing -> Turing Submissions
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
ruff_riders91




PostPosted: Tue Dec 09, 2003 11:41 am   Post subject: draw die

setscreen ("graphics")
var x, y, x2, y2, h, die : int
loop
randint (h, 10, maxy)
randint (x, 0, maxx - h)
randint (y, 0, maxy - h)
randint (die, 1, 6)
const size := h div 15
const col := white
drawfill (1, 1, black, black)
drawfillbox (x, y, x + h, y + h, brightred)
case die of
label 1 :
drawfilloval (x + h div 2, y + h div 2, size, size, col)
label 2 :
drawfilloval (x + h div 5, y + h div 5, size, size, col)
drawfilloval (x + h div 5 * 4, y + h div 5 * 4, size, size, col)
label 3 :
drawfilloval (x + h div 2, y + h div 2, size, size, col)
drawfilloval (x + h div 5, y + h div 5, size, size, col)
drawfilloval (x + h div 5 * 4, y + h div 5 * 4, size, size, col)
label 4 :
drawfilloval (x + h div 5, y + h div 5, size, size, col)
drawfilloval (x + h div 5 * 4, y + h div 5 * 4, size, size, col)
drawfilloval (x + h div 5 * 4, y + h div 5, size, size, col)
drawfilloval (x + h div 5, y + h div 5 * 4, size, size, col)
label 5 :
drawfilloval (x + h div 5, y + h div 5, size, size, col)
drawfilloval (x + h div 5 * 4, y + h div 5 * 4, size, size, col)
drawfilloval (x + h div 5 * 4, y + h div 5, size, size, col)
drawfilloval (x + h div 5, y + h div 5 * 4, size, size, col)
drawfilloval (x + h div 2, y + h div 2, size, size, col)
label 6 :
drawfilloval (x + h div 5, y + h div 5, size, size, col)
drawfilloval (x + h div 5 * 4, y + h div 5 * 4, size, size, col)
drawfilloval (x + h div 5 * 4, y + h div 5, size, size, col)
drawfilloval (x + h div 5, y + h div 5 * 4, size, size, col)
drawfilloval (x + h div 5, y + h div 2, size, size, col)
drawfilloval (x + h div 5 * 4, y + h div 2, size, size, col)

end case
delay (200)
cls
end loop
Sponsor
Sponsor
Sponsor
sponsor
Dan




PostPosted: Tue Dec 09, 2003 3:14 pm   Post subject: (No subject)

nice, whould be usfull for making one of thous die based games.

have some bits
Computer Science Canada Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more!
PaddyLong




PostPosted: Tue Dec 09, 2003 4:15 pm   Post subject: (No subject)

turn it into a function and it'd be perfect
Triple Five




PostPosted: Wed Dec 10, 2003 1:38 pm   Post subject: (No subject)

kool Very Happy man! good for craps.... thanks for the programming im gonna see if i can make a craps game and post it
Display posts from previous:   
   Index -> Programming, Turing -> Turing Submissions
View previous topic Tell A FriendPrintable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 4 Posts ]
Jump to:   


Style:  
Search: