Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
TerrellKl
Novice


Joined: 30 Aug 2005
Posts: 49

PostPosted: Fri Jan 06, 2006 4:30 am   

Hangman
 
Trying to make hangman, not sure how to substitute only one character..
I want to substitute Scavenger for ----e--e-
how can this be done?

Also.. I need a way to randomly add empty 7 times into a variable and full 1.. every time
anyway to do that?


Last edited by TerrellKl on Fri Jan 06, 2006 5:18 am; edited 1 time in total
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Fri Jan 06, 2006 5:12 am   
 
#VAR Guess Scavenger
#VAR Guessed {}

#LOOP %len(@Guess) {#VAR Guesed %concat(@Guessed,"-")}

#alias Guess {#loop %len(@guess) {#IF (%lower(copy(@Guess,%i,1)) == %lower(%1)) {#VAR Guessed %concat(%copy(@Guessed,1,%i-1),%lower(%1),%copy(@Guessed,%i+1,%len(@Guessed)))}}

Something like that (untested). Proably a sleeker way but I can not see it.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net