Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- \ Character race
- variable 1p
- variable 2p
- 72 constant finish-line
- : 2dice
- dup random swap random + ;
- : place1
- 1p @ 3 at ." 1>" ;
- : place2
- 2p @ 7 at 50 ." 2>" ;
- : calculate
- dup @ 3 2dice + swap ! ;
- : .finish-line
- 12 0 do
- finish-line i at 124 femit
- loop ;
- : init
- 0 1p ! 0 2p ! place1 place2 .finish-line cursor-off ;
- : crace
- init
- begin
- cls
- .finish-line
- place1
- place2
- 1p calculate
- 2p calculate
- 1p @ finish-line > 2p @ finish-line > or
- until
- cls
- .finish-line
- place1
- place2
- cr
- 1p @ 2p @ > if ." One wins!" then
- 2p @ 1p @ > if ." Two wins!" then
- 1p @ 2p @ = if ." It's a tie!" then
- cr
- cursor-on ;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement