@program ld5slots.muf 1 1000 d i $include $lib/alynna lvar temp lvar slot1 lvar slot2 lvar slot3 : slot ( -- i ) random 100 % temp ! temp @ 98 >= if 1 exit then temp @ 95 >= if 2 exit then temp @ 90 >= if 3 exit then temp @ 80 >= if 4 exit then temp @ 70 >= if 5 exit then temp @ 50 >= if 6 exit then temp @ 30 >= if 7 exit then temp @ 0 >= if 8 exit then ; : slotval ( i -- i ) temp ! temp @ 1 = if 50 exit then temp @ 2 = if 30 exit then temp @ 3 = if 20 exit then temp @ 4 = if 10 exit then temp @ 5 = if 5 exit then temp @ 6 = if 3 exit then temp @ 7 = if 2 exit then temp @ 8 = if 1 exit then ; : slottxt ( i -- i ) temp ! temp @ 1 = if "====Bar====" exit then temp @ 2 = if "$--Kruft--$" exit then temp @ 3 = if "@---Paw---@" exit then temp @ 4 = if "*--Lens---*" exit then temp @ 5 = if "!--Tails--!" exit then temp @ 6 = if "{--Melon--}" exit then temp @ 7 = if "%-Cherry--%" exit then temp @ 8 = if "(--Lemon--)" exit then ; : main me @ name "Kakur" smatch not if me @ "~slottime" getprop dup if dup int? if systime over - 5 < if me @ "The machine is resetting (5 seconds)..." notify exit then then then then slot slot1 ! slot slot2 ! slot slot3 ! me @ pennies 5 >= if me @ -5 addpennies str "You insert 5 kruft and pull the lever!" cat "Slots" pretty tellme else str "You dont have enough kruft. " cat "Slots" pretty tellme then ( show it ) str slot1 @ slottxt " " slot2 @ slottxt " " slot3 @ slottxt cat "Slots" pretty tellme ( check for 3 winnings ) slot1 @ slot2 @ = slot2 @ slot3 @ = and if str slot1 @ slottxt " " slot2 @ slottxt " " slot3 @ slottxt cat me @ name pretty tellhere str "WIN! 3 in a row! " me @ " wins *" slot1 @ slotval 10 * "* kruft!" cat "Slots" pretty tellhere me @ slot1 @ slotval 10 * addpennies else ( check for 2 winnings ) slot1 @ slot2 @ = slot1 @ 6 <= and if str slot1 @ slottxt " " slot2 @ slottxt " " slot3 @ slottxt cat me @ name pretty tellhere str "WIN! 2 in a row! " me @ " wins *" slot1 @ slotval 3 * "* kruft!" cat "Slots" pretty tellhere me @ slot1 @ slotval 3 * addpennies else ( check for 1 winnings ) slot1 @ 4 <= if str slot1 @ slottxt " " slot2 @ slottxt " " slot3 @ slottxt cat me @ name pretty tellhere str "WIN! " me @ " wins *" slot1 @ slotval "* kruft!" cat "Slots" pretty tellhere me @ slot1 @ slotval 1 * addpennies then then then me @ "~slottime" systime setprop ; . c q