REBOL[Title: "Yahtzee"] random/seed now num: 0 roll: func["Roll a die" ][rejoin["dice" (random 6) ".jpg"]] color: func["Change Color" pcolor [tuple!]"current color"][either pcolor = red [pcolor: 110.120.130][pcolor: red]] view layout[ backdrop 239.235.222 origin space 4x4 across text "Roll Number:" rn: text "0" return d1: button %"dice1.jpg" 55x55 [if num > 0 [d1/edge/color: color d1/edge/color show d1]] d2: button %"dice2.jpg" 55x55 [if num > 0 [d2/edge/color: color d2/edge/color show d2]] d3: button %"dice3.jpg" 55x55 [if num > 0 [d3/edge/color: color d3/edge/color show d3]] d4: button %"dice4.jpg" 55x55 [if num > 0 [d4/edge/color: color d4/edge/color show d4]] d5: button %"dice5.jpg" 55x55 [if num > 0 [d5/edge/color: color d5/edge/color show d5]] return b: button "Roll" [ if num < 3[ rn/text: num: num + 1 show rn if d1/edge/color <> red [d1/image: load to-file roll show d1] if d2/edge/color <> red [d2/image: load to-file roll show d2] if d3/edge/color <> red [d3/image: load to-file roll show d3] if d4/edge/color <> red [d4/image: load to-file roll show d4] if d5/edge/color <> red [d5/image: load to-file roll show d5] ]] button "Restart"[rn/text: num: 0 show rn d1/edge/color: d2/edge/color: d3/edge/color: d4/edge/color: d5/edge/color: 110.120.130 show d1 show d2 show d3 show d4 show d5 ] ]