cannot get how to finish my bingo game
Author |
Message |
themunit
|
Posted: Wed Jan 21, 2015 6:59 pm Post subject: cannot get how to finish my bingo game |
|
|
What is it you are trying to achieve?
I am trying to make a working bingo game with graphics
What is the problem you are having?
I have the the starting screen and instructions but when i go to start the game i get stuck on how to make the randint which is the rolled ball check with the numbers on the cards.
Describe what you have tried to solve this problem
tried adding if statements and no luck.
Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)
<Answer Here>
Turing: |
var start,start2, s, i : string
%Bingo Logo
drawfillbox (0, 0, maxx, maxy, 52)
drawfilloval (100, 225, 60, 100, blue)
drawfilloval (205, 225, 60, 100, red)
drawfilloval (310, 225, 60, 100, yellow)
drawfilloval (415, 225, 60, 100, purple)
drawfilloval (520, 225, 60, 100, cyan)
%Text
var intfont : int
var intfont1 : int
intfont := Font.New ("Times New Roman:66")
intfont1 := Font.New ("Times New Roman:25")
Font.Draw ("B", 70, 190, intfont, white)
Font.Draw ("I", 185, 190, intfont, white)
Font.Draw ("N", 280, 190, intfont, white)
Font.Draw ("G", 385, 190, intfont, white)
Font.Draw ("O", 490, 190, intfont, white)
Font.Draw (".PLAY GAME Type(s)Then Press Enter twice", 35, 85, intfont1, white)
Font.Draw (".INSTRUCTIONS Type (i)Then Press Enter", 35, 45, intfont1, white)
get start
if start = "i" then
drawfillbox (0, 0, maxx, maxy, magenta)
var intfont3 : int
var intfont2 : int
var infront1 : int
intfont3 := Font.New ("Times New Roman:18")
intfont2 := Font.New ("Times New Roman:12")
intfont1 := Font.New ("Times New Roman:25")
Font.Draw ("Instructions:", 25, 350, intfont3, white)
Font.Draw ("These are the instructions to play bingo. To play Bingo on this program, The program will generate ", 25, 325, intfont2, white)
Font.Draw ("2 playing cards. The program will ask you if you want to roll a number. Type yes and it will roll a ", 25, 300, intfont2, white)
Font.Draw ("number for you. If you have a row of numbers, whether it is up, down, or diagonal, type bingo and ", 25, 275, intfont2, white)
Font.Draw ("winning screen will pop up. if the other player gets bingo before you, the losing screen will pop up. ", 25, 250, intfont2, white)
Font.Draw ("After each game will be asked if you want to play again or go back to the main menu. ", 25, 225, intfont2, white)
Font.Draw ("I hope you enjoy our game!!!!", 25, 150, intfont2, white)
Font.Draw ("Play BINGO (p) Then enter ", 150, 80, intfont1, white)
end if
get start
if start = "p" then
drawfillbox (0, 0, maxx, maxy, green)
%first card / player card
drawline (0, 270, 0, 0, white)
drawline (270, 0, 0, 0, white)
drawline (270, 270, 270, 0, white)
drawline (1, 270, 270, 270, white)
drawfill (10, 50, white, white)
var intfont4 : int
intfont := Font.New ("Times New Roman:18")
Font.Draw ("B", 10, 250, intfont, 39)
Font.Draw ("I", 70, 250, intfont, 39)
Font.Draw ("N", 130, 250, intfont, 39)
Font.Draw ("G", 180, 250, intfont, 39)
Font.Draw ("O", 230, 250, intfont, 39)
drawline (210, 270, 210, 0, black)
drawline (160, 270, 160, 0, black)
drawline (110, 270, 110, 0, black)
drawline (50, 270, 50, 0, black)
drawline (0, 240, 270, 240, black)
drawline (0, 190, 270, 190, black)
drawline (0, 140, 270, 140, black)
drawline (0, 90, 270, 90, black)
drawline (0, 40, 270, 40, black)
%second card / AI card
drawline (300, 270, 300, 0, white)
drawline (300, 0, 600, 0, white)
drawline (600, 270, 600, 0, white)
drawline (300, 270, 600, 270, white)
drawfill (350, 200, white, white)
intfont := Font.New ("Times New Roman:18")
Font.Draw ("B", 310, 250, intfont, 39)
Font.Draw ("I", 370, 250, intfont, 39)
Font.Draw ("N", 440, 250, intfont, 39)
Font.Draw ("G", 505, 250, intfont, 39)
Font.Draw ("O", 565, 250, intfont, 39)
drawline (345, 270, 345, 0, black)
drawline (405, 270, 405, 0, black)
drawline (480, 270, 480, 0, black)
drawline (545, 270, 545, 0, black)
drawline (300, 240, 600, 240, black)
drawline (300, 190, 600, 190, black)
drawline (300, 140, 600, 140, black)
drawline (300, 90, 600, 90, black)
drawline (300, 40, 600, 40, black)
% top numbers
locate (12, 3)
color (black)
put "1" ..
locate (12, 10)
color (black)
put "2" ..
locate (12, 17)
color (black)
put "3" ..
locate (12, 24)
color (black)
put "4" ..
locate (12, 31)
color (black)
put "5" ..
locate (15, 3)
color (black)
put "6" ..
locate (15, 10)
color (black)
put "7" ..
locate (15, 17)
color (black)
put "8" ..
locate (15, 24)
color (black)
put "9" ..
locate (15, 30)
color (black)
put "10" ..
locate (18, 3)
color (black)
put "11" ..
locate (18, 10)
color (black)
put "12" ..
locate (18, 17)
color (black)
put "13" ..
locate (18, 23)
color (black)
put "14" ..
locate (18, 30)
color (black)
put "15" ..
locate (21, 3)
color (black)
put "16" ..
locate (21, 10)
color (black)
put "17" ..
locate (21, 17)
color (black)
put "18" ..
locate (21, 23)
color (black)
put "19" ..
locate (21, 30)
color (black)
put "20" ..
locate (24, 3)
color (black)
put "21" ..
locate (24, 10)
color (black)
put "22" ..
locate (24, 17)
color (black)
put "23" ..
locate (24, 23)
color (black)
put "24" ..
locate (24, 30)
color (black)
put "25" ..
locate (12, 40)
color(black)
put"1"..
locate (12, 47)
color(black)
put"2"..
locate (12, 55)
color(black)
put"3"..
locate (12, 65)
color(black)
put"4"..
locate (12, 72)
color(black)
put"5"..
locate (15, 40)
color(black)
put"6"..
locate (15, 47)
color(black)
put"7"..
locate (15, 55)
color(black)
put"8"..
locate (15, 65)
color(black)
put"9"..
locate (15, 72)
color(black)
put"10"..
locate (18, 40)
color(black)
put"11"..
locate (18, 47)
color(black)
put"12"..
locate (18, 55)
color(black)
put"13"..
locate (18, 65)
color(black)
put"14"..
locate (18, 72)
color(black)
put"15"..
locate (21, 40)
color(black)
put"16"..
locate (21, 47)
color(black)
put"17"..
locate (21, 55)
color(black)
put"18"..
locate (21, 65)
color(black)
put"19"..
locate(21, 72)
color(black)
put"20"..
locate(24, 40)
color(black)
put"21"..
locate(24, 47)
color(black)
put"22"..
locate(24, 55)
color(black)
put"23"..
locate(24, 65)
color(black)
put"24"..
locate(24, 72)
color(black)
put"25"..
locate(1, 1)
color(39)
put"1"..
locate(1, 3)
color(39)
put"2"..
locate(1, 5)
color(39)
put"3"..
locate(1, 7)
color(39)
put"4"..
locate(1, 9)
color(39)
put"5"..
locate (1, 11)
color(39)
put"6"..
locate(1, 13)
color(39)
put"7"..
locate(1, 15)
color(39)
put"8"..
locate(1, 17)
color(39)
put"9"..
locate(1, 19)
color(39)
put"10"..
locate(1, 22)
color(39)
put"11"..
locate(1, 25)
color(39)
put"12"..
locate(1, 28)
color(39)
put"13"..
locate(1, 31)
color(39)
put"15"..
locate(1, 34)
color(39)
put"16"..
locate(1, 37)
color(39)
put"17"..
locate(1, 40)
color(39)
put"18"..
locate(1, 43)
color(39)
put"19"..
locate(1, 46)
color(39)
put"20"..
locate(1, 49)
color(39)
put"21"..
locate(1, 52)
color(39)
put"22"..
locate(1, 55)
color(39)
put"23"..
locate(1, 58)
color(39)
put"24"..
locate(1, 61)
color(39)
put"25"..
locate(2, 1)
color(39)
put"26"..
locate(2, 4)
color(39)
put"27"..
locate(2, 7)
color(39)
put"28"..
locate(2, 10)
color(39)
put"29"..
locate(2, 13)
color(39)
put"30"..
locate(2, 16)
color(39)
put"31"..
locate(2, 19)
color(39)
put"32"..
locate(2, 22)
color(39)
put"33"..
locate(2, 25)
color(39)
put"34"..
locate(2, 28)
color(39)
put"35"..
locate(2, 31)
color(39)
put"36"..
locate(2, 34)
color(39)
put"37"..
locate(2, 37)
color(39)
put"38"..
locate(2, 40)
color(39)
put"39"..
locate(2, 43)
color(39)
put"40"..
locate(2, 46)
color(39)
put"41"..
locate(2, 49)
color(39)
put"42"..
locate(2, 52)
color(39)
put"43"..
locate(2, 55)
color(39)
put"44"..
locate(2, 58)
color(39)
put"45"..
locate(2, 61)
color(39)
put"46"..
locate(2, 64)
color(39)
put"47"..
locate(2, 67)
color(39)
put"48"..
locate(2, 70)
color(39)
put"49"..
locate(2, 73)
color(39)
put"50"..
locate(3, 1)
color(39)
put"51"..
locate(3, 4)
color(39)
put"52"..
locate(3, 7)
color(39)
put"53"..
locate(3, 10)
color(39)
put"53"..
locate(3, 13)
color(39)
put"54"..
locate(3, 16)
color(39)
put"55"..
locate(3, 19)
color(39)
put"56"..
locate(3, 22)
color(39)
put"57"..
locate(3, 25)
color(39)
put"58"..
locate(3, 28)
color(39)
put"59"..
locate(3, 31)
color(39)
put"60"..
locate(3, 34)
color(39)
put"61"..
locate(3, 37)
color(39)
put"62"..
locate(3, 40)
color(39)
put"63"..
locate(3, 43)
color(39)
put"64"..
locate(3, 46)
color(39)
put"65"..
locate(3, 49)
color(39)
put"66"..
locate(3, 52)
color(39)
put"67"..
locate(3, 55)
color(39)
put"68"..
locate(3, 58)
color(39)
put"69"..
locate(3, 61)
color(39)
put"70"..
locate(3, 64)
color(39)
put"71"..
locate(3, 67)
color(39)
put"72"..
locate(3, 70)
color(39)
put"73"..
locate(3, 73)
color(39)
put"74"..
locate(3, 73)
color(39)
put"75"..
end if
if start = "s" then
drawfillbox (0, 0, maxx, maxy, green)
%first card / player card
drawline (0, 270, 0, 0, white)
drawline (270, 0, 0, 0, white)
drawline (270, 270, 270, 0, white)
drawline (1, 270, 270, 270, white)
drawfill (10, 50, white, white)
var intfont4 : int
intfont := Font.New ("Times New Roman:18")
Font.Draw ("B", 10, 250, intfont, 39)
Font.Draw ("I", 70, 250, intfont, 39)
Font.Draw ("N", 130, 250, intfont, 39)
Font.Draw ("G", 180, 250, intfont, 39)
Font.Draw ("O", 230, 250, intfont, 39)
drawline (210, 270, 210, 0, black)
drawline (160, 270, 160, 0, black)
drawline (110, 270, 110, 0, black)
drawline (50, 270, 50, 0, black)
drawline (0, 240, 270, 240, black)
drawline (0, 190, 270, 190, black)
drawline (0, 140, 270, 140, black)
drawline (0, 90, 270, 90, black)
drawline (0, 40, 270, 40, black)
%second card / AI card
drawline (300, 270, 300, 0, white)
drawline (300, 0, 600, 0, white)
drawline (600, 270, 600, 0, white)
drawline (300, 270, 600, 270, white)
drawfill (350, 200, white, white)
intfont := Font.New ("Times New Roman:18")
Font.Draw ("B", 310, 250, intfont, 39)
Font.Draw ("I", 370, 250, intfont, 39)
Font.Draw ("N", 440, 250, intfont, 39)
Font.Draw ("G", 505, 250, intfont, 39)
Font.Draw ("O", 565, 250, intfont, 39)
drawline (345, 270, 345, 0, black)
drawline (405, 270, 405, 0, black)
drawline (480, 270, 480, 0, black)
drawline (545, 270, 545, 0, black)
drawline (300, 240, 600, 240, black)
drawline (300, 190, 600, 190, black)
drawline (300, 140, 600, 140, black)
drawline (300, 90, 600, 90, black)
drawline (300, 40, 600, 40, black)
% top numbers
locate (12, 3)
color (black)
put "1" ..
locate (12, 10)
color (black)
put "2" ..
locate (12, 17)
color (black)
put "3" ..
locate (12, 24)
color (black)
put "4" ..
locate (12, 31)
color (black)
put "5" ..
locate (15, 3)
color (black)
put "6" ..
locate (15, 10)
color (black)
put "7" ..
locate (15, 17)
color (black)
put "8" ..
locate (15, 24)
color (black)
put "9" ..
locate (15, 30)
color (black)
put "10" ..
locate (18, 3)
color (black)
put "11" ..
locate (18, 10)
color (black)
put "12" ..
locate (18, 17)
color (black)
put "13" ..
locate (18, 23)
color (black)
put "14" ..
locate (18, 30)
color (black)
put "15" ..
locate (21, 3)
color (black)
put "16" ..
locate (21, 10)
color (black)
put "17" ..
locate (21, 17)
color (black)
put "18" ..
locate (21, 23)
color (black)
put "19" ..
locate (21, 30)
color (black)
put "20" ..
locate (24, 3)
color (black)
put "21" ..
locate (24, 10)
color (black)
put "22" ..
locate (24, 17)
color (black)
put "23" ..
locate (24, 23)
color (black)
put "24" ..
locate (24, 30)
color (black)
put "25" ..
locate (12, 40)
color(black)
put"1"..
locate (12, 47)
color(black)
put"2"..
locate (12, 55)
color(black)
put"3"..
locate (12, 65)
color(black)
put"4"..
locate (12, 72)
color(black)
put"5"..
locate (15, 40)
color(black)
put"6"..
locate (15, 47)
color(black)
put"7"..
locate (15, 55)
color(black)
put"8"..
locate (15, 65)
color(black)
put"9"..
locate (15, 72)
color(black)
put"10"..
locate (18, 40)
color(black)
put"11"..
locate (18, 47)
color(black)
put"12"..
locate (18, 55)
color(black)
put"13"..
locate (18, 65)
color(black)
put"14"..
locate (18, 72)
color(black)
put"15"..
locate (21, 40)
color(black)
put"16"..
locate (21, 47)
color(black)
put"17"..
locate (21, 55)
color(black)
put"18"..
locate (21, 65)
color(black)
put"19"..
locate(21, 72)
color(black)
put"20"..
locate(24, 40)
color(black)
put"21"..
locate(24, 47)
color(black)
put"22"..
locate(24, 55)
color(black)
put"23"..
locate(24, 65)
color(black)
put"24"..
locate(24, 72)
color(black)
put"25"..
locate(1, 1)
color(39)
put"1"..
locate(1, 3)
color(39)
put"2"..
locate(1, 5)
color(39)
put"3"..
locate(1, 7)
color(39)
put"4"..
locate(1, 9)
color(39)
put"5"..
locate (1, 11)
color(39)
put"6"..
locate(1, 13)
color(39)
put"7"..
locate(1, 15)
color(39)
put"8"..
locate(1, 17)
color(39)
put"9"..
locate(1, 19)
color(39)
put"10"..
locate(1, 22)
color(39)
put"11"..
locate(1, 25)
color(39)
put"12"..
locate(1, 28)
color(39)
put"13"..
locate(1, 31)
color(39)
put"15"..
locate(1, 34)
color(39)
put"16"..
locate(1, 37)
color(39)
put"17"..
locate(1, 40)
color(39)
put"18"..
locate(1, 43)
color(39)
put"19"..
locate(1, 46)
color(39)
put"20"..
locate(1, 49)
color(39)
put"21"..
locate(1, 52)
color(39)
put"22"..
locate(1, 55)
color(39)
put"23"..
locate(1, 58)
color(39)
put"24"..
locate(1, 61)
color(39)
put"25"..
locate(2, 1)
color(39)
put"26"..
locate(2, 4)
color(39)
put"27"..
locate(2, 7)
color(39)
put"28"..
locate(2, 10)
color(39)
put"29"..
locate(2, 13)
color(39)
put"30"..
locate(2, 16)
color(39)
put"31"..
locate(2, 19)
color(39)
put"32"..
locate(2, 22)
color(39)
put"33"..
locate(2, 25)
color(39)
put"34"..
locate(2, 28)
color(39)
put"35"..
locate(2, 31)
color(39)
put"36"..
locate(2, 34)
color(39)
put"37"..
locate(2, 37)
color(39)
put"38"..
locate(2, 40)
color(39)
put"39"..
locate(2, 43)
color(39)
put"40"..
locate(2, 46)
color(39)
put"41"..
locate(2, 49)
color(39)
put"42"..
locate(2, 52)
color(39)
put"43"..
locate(2, 55)
color(39)
put"44"..
locate(2, 58)
color(39)
put"45"..
locate(2, 61)
color(39)
put"46"..
locate(2, 64)
color(39)
put"47"..
locate(2, 67)
color(39)
put"48"..
locate(2, 70)
color(39)
put"49"..
locate(2, 73)
color(39)
put"50"..
locate(3, 1)
color(39)
put"51"..
locate(3, 4)
color(39)
put"52"..
locate(3, 7)
color(39)
put"53"..
locate(3, 10)
color(39)
put"53"..
locate(3, 13)
color(39)
put"54"..
locate(3, 16)
color(39)
put"55"..
locate(3, 19)
color(39)
put"56"..
locate(3, 22)
color(39)
put"57"..
locate(3, 25)
color(39)
put"58"..
locate(3, 28)
color(39)
put"59"..
locate(3, 31)
color(39)
put"60"..
locate(3, 34)
color(39)
put"61"..
locate(3, 37)
color(39)
put"62"..
locate(3, 40)
color(39)
put"63"..
locate(3, 43)
color(39)
put"64"..
locate(3, 46)
color(39)
put"65"..
locate(3, 49)
color(39)
put"66"..
locate(3, 52)
color(39)
put"67"..
locate(3, 55)
color(39)
put"68"..
locate(3, 58)
color(39)
put"69"..
locate(3, 61)
color(39)
put"70"..
locate(3, 64)
color(39)
put"71"..
locate(3, 67)
color(39)
put"72"..
locate(3, 70)
color(39)
put"73"..
locate(3, 73)
color(39)
put"74"..
locate(3, 73)
color(39)
put"75"..
end if
loop
get roll
if roll = "y" then
randint (Ball, 1, 75)
end if
if Ball = 1 then
% %win screen
% var c : int
% loop
% randint (c, 37, 62)
% delay (100)
% drawfillbox (0, 0, maxx, maxy, c)
% drawfilloval (330, 230, 155, 155, 14)
% drawfilloval (260, 270, 25, 35, black)
% drawfilloval (400, 270, 25, 35, black)
% drawfillarc (330, 170, 50, 50, 180, 0, black)
% end loop
% %
% var intfont : int
% var intfont1 : int
% var intfont2 : int
% intfont := Font.New ("Times New Roman:50")
% intfont1 := Font.New ("Times New Roman:15")
% intfont2 := Font.New ("Times New Roman:15")
% Font.Draw ("You Win! ", 200, 25, intfont, black)
% Font.Draw ("To Main Menu (m) ", 5, 200, intfont1, black)
% Font.Draw ("Replay BINGO! (r) ", 5, 170, intfont2, black)
% end loop
% %LOSE
% drawfillbox (0, 0, maxx, maxy, red)
% drawfilloval (330, 230, 155, 155, 14)
% drawfilloval (260, 270, 25, 35, black)
% drawfilloval (400, 270, 25, 35, black)
% drawarc (330, 140, 50, 20, 0, 180, black)
% drawarc (330, 139, 50, 20, 0, 180, black)
% drawarc (330, 138, 50, 20, 0, 180, black)
% drawarc (330, 137, 50, 20, 0, 180, black)
%
% var intfont : int
% var intfont1 : int
% var intfont2 : int
% intfont := Font.New("Times New Roman:50")
% intfont1 := Font.New("Times New Roman:15")
% intfont2 := Font.New("Times New Roman:15")
% Font.Draw ("You lose! ", 200, 25, intfont, white)
% Font.Draw ("To Main Menu (m) ", 5, 200, intfont1, white)
% Font.Draw ("Replay BINGO! (r) ", 5, 170, intfont2, white)
|
Please specify what version of Turing you are using
latest version |
|
|
|
|
|
Sponsor Sponsor
|
|
|
|
|