View script | License | Download script | History | Other scripts by: notchent |
3-May 14:13 UTC
[0.037] 10.772k
[0.037] 10.772k
Archive version of: trictrac.r ... version: 3 ... notchent 10-Nov-2013REBOL [ title: "Tric Trac" date: 7-Nov-2013 file: %trictrac.r author: Nick Antonaccio purpose: { A quick implementation of a simple board game. Created with a student as a tutorial example. } ] random/seed now/time view center-face layout [ backdrop white across style tog toggle tan 50x100 [ sum: 0 show face foreach bttn [a b c d e f g h i j k l] [ do rejoin [ {if not find } bttn {/text "(" [sum: sum + to-integer } bttn {/text]} ] ] if not find u/text "(" [u/text: rejoin ["(" u/text ")"] show u] t/text: form sum show t ] a: tog "1" "" b: tog "2" "" c: tog "3" "" d: tog "4" "" e: tog "5" "" f: tog "6" "" g: tog "7" "" h: tog "8" "" i: tog "9" "" j: tog "10" "" k: tog "11" "" l: tog "12" "" return u: btn 690x50 font-size 20 "Roll" [ face/text: (form (1 + random 11)) show face ] return t: text bold "Total" text "Save" [write %trictrac t/text] text "Previous High" [attempt [alert read %trictrac]] ] |