help with dice for turing
Posted: Mon Jan 24, 2005 1:16 pm
this is my dice i need to modify so it shows a chart after 100 rolls that how many times each number came also i need help making a graph for it thankz
setscreen ("graphics")
var die1, die2, die3, die4 : int
var number : int
var amount, wager : real
procedure box1
drawbox (100, 100, 200, 200, 7)
drawfill (101, 101, 3, 7)
end box1
procedure box2
drawbox (250, 100, 350, 200, 7)
drawfill (251, 101, 3, 7)
end box2
loop
drawfill (99, 99, 5, 7)
randint (die1, 1, 6)
randint (die2, 1, 6)
if die1 = 1 then
drawbox (140, 140, 160, 160, 7)
drawfill (141, 141, 7, 7)
end if
if die2 = 1 then
drawbox (290, 160, 310, 140, 7)
drawfill (291, 159, 7, 7)
end if
if die1 = 2 then
drawbox (115, 186, 135, 165, 7)
drawfill (116, 185, 7, 7)
drawbox (185, 115, 165, 135, 7)
drawfill (184, 116, 7, 7)
end if
if die2 = 2 then
drawbox (265, 186, 285, 165, 7)
drawfill (266, 185, 7, 7)
drawbox (315, 115, 335, 135, 7)
drawfill (316, 116, 7, 7)
end if
if die1 = 3 then
drawbox (140, 140, 160, 160, 7)
drawfill (141, 141, 7, 7)
drawbox (115, 186, 135, 165, 7)
drawfill (116, 185, 7, 7)
drawbox (185, 115, 165, 135, 7)
drawfill (184, 116, 7, 7)
end if
if die2 = 3 then
drawbox (290, 160, 310, 140, 7)
drawfill (291, 159, 7, 7)
drawbox (265, 186, 285, 165, 7)
drawfill (266, 185, 7, 7)
drawbox (315, 115, 335, 135, 7)
drawfill (316, 116, 7, 7)
end if
if die1 = 4 then
drawbox (115, 186, 135, 165, 7)
drawfill (116, 185, 7, 7)
drawbox (185, 115, 165, 135, 7)
drawfill (184, 116, 7, 7)
drawbox (115, 115, 135, 135, 7)
drawfill (116, 116, 7, 7)
drawbox (165, 185, 185, 165, 7)
drawfill (166, 184, 7, 7)
end if
if die2 = 4 then
drawbox (265, 186, 285, 165, 7)
drawfill (266, 185, 7, 7)
drawbox (315, 115, 335, 135, 7)
drawfill (316, 116, 7, 7)
drawbox (315, 186, 335, 165, 7)
drawfill (316, 185, 7, 7)
drawbox (265, 115, 285, 135, 7)
drawfill (266, 116, 7, 7)
end if
if die1 = 5 then
drawbox (115, 186, 135, 165, 7)
drawfill (116, 185, 7, 7)
drawbox (185, 115, 165, 135, 7)
drawfill (184, 116, 7, 7)
drawbox (115, 115, 135, 135, 7)
drawfill (116, 116, 7, 7)
drawbox (165, 185, 185, 165, 7)
drawfill (166, 184, 7, 7)
drawbox (140, 140, 160, 160, 7)
drawfill (141, 141, 7, 7)
end if
if die2 = 5 then
drawbox (265, 186, 285, 165, 7)
drawfill (266, 185, 7, 7)
drawbox (315, 115, 335, 135, 7)
drawfill (316, 116, 7, 7)
drawbox (315, 186, 335, 165, 7)
drawfill (316, 185, 7, 7)
drawbox (265, 115, 285, 135, 7)
drawfill (266, 116, 7, 7)
drawbox (290, 160, 310, 140, 7)
drawfill (291, 159, 7, 7)
end if
if die1 = 6 then
drawbox (115, 186, 135, 165, 7)
drawfill (116, 185, 7, 7)
drawbox (185, 115, 165, 135, 7)
drawfill (184, 116, 7, 7)
drawbox (115, 115, 135, 135, 7)
drawfill (116, 116, 7, 7)
drawbox (165, 185, 185, 165, 7)
drawfill (166, 184, 7, 7)
drawbox (115, 140, 135, 160, 7)
drawfill (116, 141, 7, 7)
drawbox (185, 139, 165, 160, 7)
drawfill (184, 140, 7, 7)
end if
if die2 = 6 then
drawbox (265, 186, 285, 165, 7)
drawfill (266, 185, 7, 7)
drawbox (315, 115, 335, 135, 7)
drawfill (316, 116, 7, 7)
drawbox (315, 186, 335, 165, 7)
drawfill (316, 185, 7, 7)
drawbox (265, 115, 285, 135, 7)
drawfill (266, 116, 7, 7)
drawbox (265, 160, 285, 140, 7)
drawfill (266, 159, 7, 7)
drawbox (315, 160, 335, 140, 7)
drawfill (316, 159, 7, 7)
end if
delay (500)
cls
randomize
box1
box2
%Fills in the background
drawfill (99, 99, 5, 7)
randint (die3, 1, 6)
randint (die4, 1, 6)
if die3 = 1 then
drawbox (140, 140, 160, 160, 7)
drawfill (141, 141, 7, 7)
end if
if die4 = 1 then
drawbox (290, 160, 310, 140, 7)
drawfill (291, 159, 7, 7)
end if
if die3 = 2 then
drawbox (115, 186, 135, 165, 7)
drawfill (116, 185, 7, 7)
drawbox (185, 115, 165, 135, 7)
drawfill (184, 116, 7, 7)
end if
if die4 = 2 then
drawbox (265, 186, 285, 165, 7)
drawfill (266, 185, 7, 7)
drawbox (315, 115, 335, 135, 7)
drawfill (316, 116, 7, 7)
end if
if die3 = 3 then
drawbox (140, 140, 160, 160, 7)
drawfill (141, 141, 7, 7)
drawbox (115, 186, 135, 165, 7)
drawfill (116, 185, 7, 7)
drawbox (185, 115, 165, 135, 7)
drawfill (184, 116, 7, 7)
end if
if die4 = 3 then
drawbox (290, 160, 310, 140, 7)
drawfill (291, 159, 7, 7)
drawbox (265, 186, 285, 165, 7)
drawfill (266, 185, 7, 7)
drawbox (315, 115, 335, 135, 7)
drawfill (316, 116, 7, 7)
end if
if die3 = 4 then
drawbox (115, 186, 135, 165, 7)
drawfill (116, 185, 7, 7)
drawbox (185, 115, 165, 135, 7)
drawfill (184, 116, 7, 7)
drawbox (115, 115, 135, 135, 7)
drawfill (116, 116, 7, 7)
drawbox (165, 185, 185, 165, 7)
drawfill (166, 184, 7, 7)
end if
if die4 = 4 then
drawbox (265, 186, 285, 165, 7)
drawfill (266, 185, 7, 7)
drawbox (315, 115, 335, 135, 7)
drawfill (316, 116, 7, 7)
drawbox (315, 186, 335, 165, 7)
drawfill (316, 185, 7, 7)
drawbox (265, 115, 285, 135, 7)
drawfill (266, 116, 7, 7)
end if
if die3 = 5 then
drawbox (115, 186, 135, 165, 7)
drawfill (116, 185, 7, 7)
drawbox (185, 115, 165, 135, 7)
drawfill (184, 116, 7, 7)
drawbox (115, 115, 135, 135, 7)
drawfill (116, 116, 7, 7)
drawbox (165, 185, 185, 165, 7)
drawfill (166, 184, 7, 7)
drawbox (140, 140, 160, 160, 7)
drawfill (141, 141, 7, 7)
end if
if die4 = 5 then
drawbox (265, 186, 285, 165, 7)
drawfill (266, 185, 7, 7)
drawbox (315, 115, 335, 135, 7)
drawfill (316, 116, 7, 7)
drawbox (315, 186, 335, 165, 7)
drawfill (316, 185, 7, 7)
drawbox (265, 115, 285, 135, 7)
drawfill (266, 116, 7, 7)
drawbox (290, 160, 310, 140, 7)
drawfill (291, 159, 7, 7)
end if
if die3 = 6 then
drawbox (115, 186, 135, 165, 7)
drawfill (116, 185, 7, 7)
drawbox (185, 115, 165, 135, 7)
drawfill (184, 116, 7, 7)
drawbox (115, 115, 135, 135, 7)
drawfill (116, 116, 7, 7)
drawbox (165, 185, 185, 165, 7)
drawfill (166, 184, 7, 7)
drawbox (115, 140, 135, 160, 7)
drawfill (116, 141, 7, 7)
drawbox (185, 139, 165, 160, 7)
drawfill (184, 140, 7, 7)
end if
if die4 = 6 then
drawbox (265, 186, 285, 165, 7)
drawfill (266, 185, 7, 7)
drawbox (315, 115, 335, 135, 7)
drawfill (316, 116, 7, 7)
drawbox (315, 186, 335, 165, 7)
drawfill (316, 185, 7, 7)
drawbox (265, 115, 285, 135, 7)
drawfill (266, 116, 7, 7)
drawbox (265, 160, 285, 140, 7)
drawfill (266, 159, 7, 7)
drawbox (315, 160, 335, 140, 7)
drawfill (316, 159, 7, 7)
end if
end loop
Archived topic from Iceteks, old topic ID:3057, old post ID:25052