Acronym Game
A game where a group of players receives an acronym from which to make a sentence out of.
Functions:
add(),
after(),
ansi(),
cand(),
comp(),
die(),
edit(),
elements(),
emit(),
eq(),
extract(),
first(),
gt(),
gte(),
hasattr(),
hasattrval(),
if(),
iter(),
itext(),
lattr(),
lcstr(),
left(),
ljust(),
lmath(),
lte(),
munge(),
name(),
neq(),
not(),
oemit(),
pemit(),
regrep(),
rjust(),
set(),
setq(),
setunion(),
shuffle(),
sort(),
squish(),
strlen(),
strmatch(),
switch(),
u(),
ucstr(),
v(),
wipe(),
words().
Features:
regexp commands.
Instructions
Copy and paste the below code into a compatible MUSH or MUX.
MUSHCode for Acronym Game
@create Acronym parent
@link Acronym parent = #0
@lock/Basic Acronym parent==me
@lset Acronym parent/Basic=no_inherit
@set Acronym parent = !NO_COMMAND
&CMD.ADDLEGENDARY Acronym parent=$+addlegendary *:think [set(me,leg.%vb:%0)][set(me/leg.%vb,no_command)][set(me,vb:[add(%vb,1)])]
&CMD.CLEAR Acronym parent=$+clear:think u(fun.clear)
&CMD.END Acronym parent=$+end:think u(fun.end)
&CMD.EQPLAY Acronym parent=$=play *:think u(fun.play,%0)
&CMD.LEGENDARY Acronym parent=$+legendary:@pemit %#=Legendary Acronyms:%r%r%b%b[iter(lattr(me/leg.*),v(##),%b,%r%b%b)]%r
&CMD.PLAY Acronym parent=$+play *:think u(fun.play,%0)
&CMD.SCORE Acronym parent=$+score:think u(fun.score)
&CMD.START Acronym parent=$+start:think u(fun.start)
&CMD.VOTE Acronym parent=$^\+vote ([0-9]+)$:think u(fun.vote,%1)
@set Acronym parent/CMD.VOTE=regexp
&D.DONE Acronym parent=Acro Game Board!%r%rCurrent Topic: %b [v(topic)]%rCurrent Acronym: [v(play.acronym)]%r%r%bName%b%b%b%b%b%bVotes%bAcronym:%r%r[iter(v(play.posters),[ljust(name(##),11)][rjust(words(regrep(me,v.*,^[itext(0)]$)),3)]%b%b%b[v(S.[itext(0)])],%b,%r)]
&D.PLAYING Acronym parent=Acro Game Board!%r%rCurrent Topic: %b [v(topic)]%rCurrent Acronym: [v(play.acronym)]%r%rHurry up and place your post! There are [words(v(play.posters))] posts on the board.
&D.VOTING Acronym parent=Acro Game Board!%r%rCurrent Topic: %b [v(topic)]%rCurrent Acronym: [v(play.acronym)]%r%r%bNum%bVotes Acronym:%r%r[iter(v(play.posters),[rjust(#@,3)]%b[rjust(words(regrep(me,v.*,^[itext(0)]$)),4)]%b%b%b[v(s.[itext(0)])],%b,%r)]
&DESCRIBE Acronym parent=u(d.[v(state)])%r%r[ansi(h,use [name(me)])] for instructions
@set Acronym parent/DESCRIBE=no_command visual public nearby
&FUN.CLEAR Acronym parent=pemit(%#,You clear the Acro board.)[oemit(%#,%N clears the Acro board.)][wipe(me/score.*)][wipe(me/v.*)][wipe(me/s.*)][wipe(me/topic)][wipe(me/play.*)]
&FUN.END Acronym parent=switch(v(state),voting,u(fun.end.voting),playing,u(fun.end.playing),pemit(%#,You cannot end a stopped game. Use [ansi(h,+start)] to start a new one))
&FUN.END.PLAYING Acronym parent=pemit(%#,You end the playing round. You may now vote.)[oemit(%#,%n ends the playing round. You may now vote.)][set(me,state:voting)][set(me,play.posters:[shuffle(v(play.posters))])]
&FUN.END.VOTING Acronym parent=pemit(%#,You end the voting round. Results are now posted.)[oemit(%#,%N Ends the voting round. Results are now posted.)][set(me,state:done)][u(h.score)]
&FUN.PLAY Acronym parent=switch(0,strmatch(v(state),playing),pemit(%#,Can't post now),u(h.is_acronym,%0),pemit(%#,That's not a correct acronym!),if(hasattr(me,s.%#),pemit(%#,You replace your former one with: "%0"),pemit(%#,You post: "%0"))[set(me,s.%#:%0)][set(me/s.%#,no_command)][set(me,time.%#:%va)][set(me,va:[add(%va,1)])][set(me,play.posters:[setunion(v(play.posters),%#)])])
&FUN.PLAY2 Acronym parent=if(not(u(h.is_acronym,%0)),pemit(%#,That's not a correct acronym!),if(hasattr(me,s.%#),pemit(%#,You replace your former one with %0),pemit(%#,You post %0))[set(me,s.%#:%0)][set(me,play.posters:[setunion(v(play.posters),%#)])])
&FUN.SCORE Acronym parent=pemit(%#,Scoreboard for the current series:%r[iter(lattr(me/score.*),ljust(name(after(##,.)),15)%b[v(##)],%b,%r)]
&FUN.START Acronym parent=switch(v(state),voting,pemit(%#,The game is in voting round.),playing,pemit(%#,The game is in playing round.),done,setq(0,u(h.new_acronym))[pemit(%#,Game started. New acronym is: %q0)][oemit(%#,%N starts the game. New Acronym: %q0)][set(me,play.acronym:%q0)][set(me,state:playing)][wipe(me/v.*)][wipe(me/s.*)][wipe(me/time.*)][set(me,va:0)][u(h.topics)][wipe(me/play.posters)]
&FUN.VOTE Acronym parent=switch(0,strmatch(v(state),voting),pemit(%#,This is not the voting round.),cand(gte(%0,1),lte(%0,words(v(play.posters)))),pemit(%#,That is not a valid vote option.),not(strmatch(%#,elements(v(play.posters),%0))),pemit(%#,You can't vote for yourself!),if(hasattr(me,v.%#),pemit(%#,You change your vote to %0),pemit(%#,You vote for %0))[set(me,v.%#:[elements(v(play.posters),%0)])])
&FUN.VOTE2 Acronym parent=if(neq(comp(v(state),voting),0),pemit(%#,This is not the voting round!),if(not(cand(gte(%0,1),lte(%0,words(v(play.posters))))),pemit(%#,That is not a valid vote option.),if(hasattr(me,v.%#),pemit(%#,You change your vote to %0),pemit(%#,You place a vote for %0))[set(me,v.%#:[extract(v(play.posters),%0,1)]
&FUN.VOTES Acronym parent=switch(0,strmatch(v(state),voting),pemit(%#,This is not the voting round.),cand(gte(%0,1),lte(%0,words(v(play.posters)))),pemit(%#,That is not a valid vote option.),not(strmatch(%#,elements(v(play.posters),%0))),pemit(%#,You can't vote for yourself!),if(hasattr(me,v.%#),pemit(%#,You change your vote to %0),pemit(%#,You vote for %0))[set(me,v.%#:[elements(v(play.posters),%0)])])
&H.ADD_SCORE Acronym parent=set(me,score.%0:[add(v(score.%0),0%1)])
&H.IS_ACRONYM Acronym parent=cand(eq(words(%0),strlen(v(play.acronym))),lmath(mul,iter(edit(v(play.acronym),,%b),not(comp(lcstr(##),lcstr(left(extract(%0,#@,1),1)))))))
&H.NEW_ACRONYM Acronym parent=ucstr(edit(extract(shuffle(a a a a b b b b c c c c d d d d e e e e f f f f g g g g h h h h i i i i j j k k l l l l m m m m n n n n o o o o p p p p q r r r r s s s s t t t t u u u v v w x y y z),1,add(die(1,4),2)),%b,))
&H.SCORE Acronym parent=[setq(0,)][setq(1,)][if(gt(words(v(play.posters)),1),iter(v(play.posters),if(hasattrval(me,v.##),setq(0,%q0 ##),setq(1,%q1 ##)),%b,)[if(strlen(%q1),emit(Unable to get points this round for not voting: [iter(%q1,name(##))])))][if(strlen(%q0),iter(u(scorers),u(sc.##,%q0)))]
&H.TOPICS Acronym parent=set(me,topic:[edit(first(shuffle(v(topics))),_,%b)])[emit(The new topic is "[v(topic)]")]
&HELP.STATE Acronym parent=0: waiting. 1: making acronyms. 2: voting 3: voted.
&MUNGE.SORTER Acronym parent=sort(%0)
&SC.FIRST Acronym parent=[setq(b,iter(%0,if(gt(words(regrep(me,v.*,^[itext(0)]$)),0),itext(0)),%b,%b))][setq(a,squish(first(munge(munge.sorter,iter(%qb,v(time.[itext(0)])),%qb))))][if(strlen(%qa),emit(name(%qa) gets an extra point for being the first poster to get a vote!)[u(h.add_score,%qa,1)])]
&SC.TOTAL Acronym parent=iter(%0,u(h.add_score,itext(0),words(regrep(me,v.*,^[itext(0)]$))))
&SCORERS Acronym parent=total first
&STATE Acronym parent=done
&TOPICS Acronym parent=Anything_Goes Politics Geeks Computers Relationships/Sex Anything_Goes Anything_Goes Alcohol Fantasy Sci-fi Food Music Animals Star_Wars Star_Trek Internet Muds/Mushes
&TYPE Acronym parent=Parent Game
&USE Acronym parent=%rAre you ready for some gut holding, laugh-out-loud action? Stretch your creativity to the max!%r%r[ansi(h,+start)] will give you (and everyone else in the room) an acronym from which to make a sentence out of.%r[ansi(h,+play <acronym>)] to place your idea on the board (unseen until voting round)%r[ansi(h,+end) will put the game in voting round, use%r[ansi(h,+vote <#>)] to vote on which acronym you think is funniest.%r[ansi(h,+end)] again to see the results.%r[ansi(h,+score)] to see the score rank.%r[ansi(h,+clear)] Clear scores, plays, etc.%r[ansi(h,+legendary)] - List of legendary acronyms.%r[ansi(h,+addlegendary)] - add an acronym to the legendary list%r%rRepeat until exhausted.%r%rIf you play but don't vote, you can't get any points!%rFastest poster to get a vote gets an extra point!
@set Acronym parent/USE=no_command
&VB Acronym parent=0
@link Acronym parent = #0
@lock/Basic Acronym parent==me
@lset Acronym parent/Basic=no_inherit
@set Acronym parent = !NO_COMMAND
&CMD.ADDLEGENDARY Acronym parent=$+addlegendary *:think [set(me,leg.%vb:%0)][set(me/leg.%vb,no_command)][set(me,vb:[add(%vb,1)])]
&CMD.CLEAR Acronym parent=$+clear:think u(fun.clear)
&CMD.END Acronym parent=$+end:think u(fun.end)
&CMD.EQPLAY Acronym parent=$=play *:think u(fun.play,%0)
&CMD.LEGENDARY Acronym parent=$+legendary:@pemit %#=Legendary Acronyms:%r%r%b%b[iter(lattr(me/leg.*),v(##),%b,%r%b%b)]%r
&CMD.PLAY Acronym parent=$+play *:think u(fun.play,%0)
&CMD.SCORE Acronym parent=$+score:think u(fun.score)
&CMD.START Acronym parent=$+start:think u(fun.start)
&CMD.VOTE Acronym parent=$^\+vote ([0-9]+)$:think u(fun.vote,%1)
@set Acronym parent/CMD.VOTE=regexp
&D.DONE Acronym parent=Acro Game Board!%r%rCurrent Topic: %b [v(topic)]%rCurrent Acronym: [v(play.acronym)]%r%r%bName%b%b%b%b%b%bVotes%bAcronym:%r%r[iter(v(play.posters),[ljust(name(##),11)][rjust(words(regrep(me,v.*,^[itext(0)]$)),3)]%b%b%b[v(S.[itext(0)])],%b,%r)]
&D.PLAYING Acronym parent=Acro Game Board!%r%rCurrent Topic: %b [v(topic)]%rCurrent Acronym: [v(play.acronym)]%r%rHurry up and place your post! There are [words(v(play.posters))] posts on the board.
&D.VOTING Acronym parent=Acro Game Board!%r%rCurrent Topic: %b [v(topic)]%rCurrent Acronym: [v(play.acronym)]%r%r%bNum%bVotes Acronym:%r%r[iter(v(play.posters),[rjust(#@,3)]%b[rjust(words(regrep(me,v.*,^[itext(0)]$)),4)]%b%b%b[v(s.[itext(0)])],%b,%r)]
&DESCRIBE Acronym parent=u(d.[v(state)])%r%r[ansi(h,use [name(me)])] for instructions
@set Acronym parent/DESCRIBE=no_command visual public nearby
&FUN.CLEAR Acronym parent=pemit(%#,You clear the Acro board.)[oemit(%#,%N clears the Acro board.)][wipe(me/score.*)][wipe(me/v.*)][wipe(me/s.*)][wipe(me/topic)][wipe(me/play.*)]
&FUN.END Acronym parent=switch(v(state),voting,u(fun.end.voting),playing,u(fun.end.playing),pemit(%#,You cannot end a stopped game. Use [ansi(h,+start)] to start a new one))
&FUN.END.PLAYING Acronym parent=pemit(%#,You end the playing round. You may now vote.)[oemit(%#,%n ends the playing round. You may now vote.)][set(me,state:voting)][set(me,play.posters:[shuffle(v(play.posters))])]
&FUN.END.VOTING Acronym parent=pemit(%#,You end the voting round. Results are now posted.)[oemit(%#,%N Ends the voting round. Results are now posted.)][set(me,state:done)][u(h.score)]
&FUN.PLAY Acronym parent=switch(0,strmatch(v(state),playing),pemit(%#,Can't post now),u(h.is_acronym,%0),pemit(%#,That's not a correct acronym!),if(hasattr(me,s.%#),pemit(%#,You replace your former one with: "%0"),pemit(%#,You post: "%0"))[set(me,s.%#:%0)][set(me/s.%#,no_command)][set(me,time.%#:%va)][set(me,va:[add(%va,1)])][set(me,play.posters:[setunion(v(play.posters),%#)])])
&FUN.PLAY2 Acronym parent=if(not(u(h.is_acronym,%0)),pemit(%#,That's not a correct acronym!),if(hasattr(me,s.%#),pemit(%#,You replace your former one with %0),pemit(%#,You post %0))[set(me,s.%#:%0)][set(me,play.posters:[setunion(v(play.posters),%#)])])
&FUN.SCORE Acronym parent=pemit(%#,Scoreboard for the current series:%r[iter(lattr(me/score.*),ljust(name(after(##,.)),15)%b[v(##)],%b,%r)]
&FUN.START Acronym parent=switch(v(state),voting,pemit(%#,The game is in voting round.),playing,pemit(%#,The game is in playing round.),done,setq(0,u(h.new_acronym))[pemit(%#,Game started. New acronym is: %q0)][oemit(%#,%N starts the game. New Acronym: %q0)][set(me,play.acronym:%q0)][set(me,state:playing)][wipe(me/v.*)][wipe(me/s.*)][wipe(me/time.*)][set(me,va:0)][u(h.topics)][wipe(me/play.posters)]
&FUN.VOTE Acronym parent=switch(0,strmatch(v(state),voting),pemit(%#,This is not the voting round.),cand(gte(%0,1),lte(%0,words(v(play.posters)))),pemit(%#,That is not a valid vote option.),not(strmatch(%#,elements(v(play.posters),%0))),pemit(%#,You can't vote for yourself!),if(hasattr(me,v.%#),pemit(%#,You change your vote to %0),pemit(%#,You vote for %0))[set(me,v.%#:[elements(v(play.posters),%0)])])
&FUN.VOTE2 Acronym parent=if(neq(comp(v(state),voting),0),pemit(%#,This is not the voting round!),if(not(cand(gte(%0,1),lte(%0,words(v(play.posters))))),pemit(%#,That is not a valid vote option.),if(hasattr(me,v.%#),pemit(%#,You change your vote to %0),pemit(%#,You place a vote for %0))[set(me,v.%#:[extract(v(play.posters),%0,1)]
&FUN.VOTES Acronym parent=switch(0,strmatch(v(state),voting),pemit(%#,This is not the voting round.),cand(gte(%0,1),lte(%0,words(v(play.posters)))),pemit(%#,That is not a valid vote option.),not(strmatch(%#,elements(v(play.posters),%0))),pemit(%#,You can't vote for yourself!),if(hasattr(me,v.%#),pemit(%#,You change your vote to %0),pemit(%#,You vote for %0))[set(me,v.%#:[elements(v(play.posters),%0)])])
&H.ADD_SCORE Acronym parent=set(me,score.%0:[add(v(score.%0),0%1)])
&H.IS_ACRONYM Acronym parent=cand(eq(words(%0),strlen(v(play.acronym))),lmath(mul,iter(edit(v(play.acronym),,%b),not(comp(lcstr(##),lcstr(left(extract(%0,#@,1),1)))))))
&H.NEW_ACRONYM Acronym parent=ucstr(edit(extract(shuffle(a a a a b b b b c c c c d d d d e e e e f f f f g g g g h h h h i i i i j j k k l l l l m m m m n n n n o o o o p p p p q r r r r s s s s t t t t u u u v v w x y y z),1,add(die(1,4),2)),%b,))
&H.SCORE Acronym parent=[setq(0,)][setq(1,)][if(gt(words(v(play.posters)),1),iter(v(play.posters),if(hasattrval(me,v.##),setq(0,%q0 ##),setq(1,%q1 ##)),%b,)[if(strlen(%q1),emit(Unable to get points this round for not voting: [iter(%q1,name(##))])))][if(strlen(%q0),iter(u(scorers),u(sc.##,%q0)))]
&H.TOPICS Acronym parent=set(me,topic:[edit(first(shuffle(v(topics))),_,%b)])[emit(The new topic is "[v(topic)]")]
&HELP.STATE Acronym parent=0: waiting. 1: making acronyms. 2: voting 3: voted.
&MUNGE.SORTER Acronym parent=sort(%0)
&SC.FIRST Acronym parent=[setq(b,iter(%0,if(gt(words(regrep(me,v.*,^[itext(0)]$)),0),itext(0)),%b,%b))][setq(a,squish(first(munge(munge.sorter,iter(%qb,v(time.[itext(0)])),%qb))))][if(strlen(%qa),emit(name(%qa) gets an extra point for being the first poster to get a vote!)[u(h.add_score,%qa,1)])]
&SC.TOTAL Acronym parent=iter(%0,u(h.add_score,itext(0),words(regrep(me,v.*,^[itext(0)]$))))
&SCORERS Acronym parent=total first
&STATE Acronym parent=done
&TOPICS Acronym parent=Anything_Goes Politics Geeks Computers Relationships/Sex Anything_Goes Anything_Goes Alcohol Fantasy Sci-fi Food Music Animals Star_Wars Star_Trek Internet Muds/Mushes
&TYPE Acronym parent=Parent Game
&USE Acronym parent=%rAre you ready for some gut holding, laugh-out-loud action? Stretch your creativity to the max!%r%r[ansi(h,+start)] will give you (and everyone else in the room) an acronym from which to make a sentence out of.%r[ansi(h,+play <acronym>)] to place your idea on the board (unseen until voting round)%r[ansi(h,+end) will put the game in voting round, use%r[ansi(h,+vote <#>)] to vote on which acronym you think is funniest.%r[ansi(h,+end)] again to see the results.%r[ansi(h,+score)] to see the score rank.%r[ansi(h,+clear)] Clear scores, plays, etc.%r[ansi(h,+legendary)] - List of legendary acronyms.%r[ansi(h,+addlegendary)] - add an acronym to the legendary list%r%rRepeat until exhausted.%r%rIf you play but don't vote, you can't get any points!%rFastest poster to get a vote gets an extra point!
@set Acronym parent/USE=no_command
&VB Acronym parent=0