|
TerrellKl Novice
Joined: 30 Aug 2005 Posts: 49
|
Posted: 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 |
|
|
|
TonDiening GURU
Joined: 26 Jul 2001 Posts: 1958 Location: Canada
|
Posted: 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. |
|
|
|
|
|
|
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
|
|