: say ( s -- ) me @ swap notify ; : all ( s -- ) loc @ #-1 rot notify_except ; : notme ( s -- ) loc @ me @ rot notify_except ; : tr ( -- d ) trigger @ ; : tloc ( -- d ) trigger @ location ; : playing? ( -- i ) tr ".np" getpropstr atoi begin dup while tr ".p" 3 pick intostr strcat getpropstr atoi dbref me @ dbcmp if exit then 1 - loop ; : outstring ( -- ) tr ".pu" 3 pick intostr strcat getpropstr "| |_| |_| |_| |_| |_| |_| |_| |_| |_|_|_|_|" swap 1 begin dup 3 pick strlen 1 + < while over over strcut pop over 1 - strcut swap pop dup "0" stringcmp not if pop dup 2 % not over 17 > or if "_" else " " then then 4 rotate 3 pick 2 * strcut swap dup strlen 1 - strcut pop rot strcat swap strcat -3 rotate 1 + loop pop pop say tr ".pl" rot intostr strcat getpropstr 0 begin dup 10 < while swap over intostr "xx" strcat " " swap subst swap 1 + loop pop say ; : do_join ( -- ) playing? if "o! You are already playing." say exit then tr ".np" getpropstr atoi 1 + tr ".np" 3 pick intostr 0 addprop tr ".p" 3 pick intostr strcat me @ intostr 0 addprop "o! " me @ name strcat " joins the game." strcat all tr ".pu" 3 pick intostr strcat "000000000000000000000" 0 addprop tr ".pl" rot intostr strcat "|0xx|1xx|2xx|3xx|4xx|5xx|6xx|7xx|8xx| 9xx |" 0 addprop ; : do_score ( -- ) playing? dup not if pop "o! You are not playing." say exit then " _________________________________________" say outstring " ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" say ; : do_overhead ( -- ) tr ".np" getpropstr atoi dup not if pop "o! Nobody is playing right now." say exit then 1 begin dup 3 pick <= while tr ".p" 3 pick intostr strcat getpropstr atoi dbref name ":" strcat say " _________________________________________" say dup outstring " ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" say 1 + loop pop pop ; : do_help ( -- ) "+-------------------------------------------------+" say "| MUF-Bowling v1.1-beta, by Sjade of HoloMUCK |" say "+-------------------------------------------------+" say "| bowl -help | Get this help screen |" say "| bowl -join | Join in a game of bowling |" say "| bowl -score | Your current string status |" say "| bowl -overhead | All players' string statuses |" say "| bowl -reset | Clear scores, ready new game |" say "| bowl | Throw a shot with: |" say "| | p = push-off postion (7 - 1) |" say "| | a = arrow aimed at (7 - 1) |" say "| | h = hook direction (R N L) |" say "| | l = degree of lift (0 - 9) |" say "| | s = ball speed (0 - 9) |" say "| | (Default argument is: 23N05) |" say "+------------------+------------------------------+" say ; : do_display ( -- ) " Spots & Arrows: Hook: " say "| ! ! ! ! | /|\\" say "| ! ! ! | / | \\" say "| ! ! | / | \\" say "| ! | .< | >." say "| | | \\ | / |" say "| | | \\ | / |" say "| | R R N L L" say "| 4 | lift -> 3 7 0 7 3" say "| 5 3 | <- arrows " say "| 6 2 | " say "| 7 1 | " say "| | " say "| | " say "| | " say "| 7 6 5 4 3 2 1 | <- push-off positions " say ; : main ( -- s ) dup "-score" stringcmp not if pop do_score exit then dup "-join" stringcmp not if pop do_join exit then dup "-overhead" stringcmp not if pop do_overhead exit then dup "-help" stringcmp not if pop do_help exit then dup "-display" stringcmp not if pop do_display exit then ;