Re: word game

new topic     » goto parent     » topic index » view thread      » older message » newer message
alan123 said...

finding this euphoria a bit hard to find what i need to make the game.I need to be abel to input a sentenc and the computer to read it one word at a time to compar for matchs and remember the possion of the words which will make a code. the computer will also check this code say 123 which could mean feed the cat.then act acordingly 2 this

I think this will do it:

include std/console.e 
include std/sequence.e 
 
sequence sentence = prompt_string("Enter sentence:") 
sequence words = split_any(sentence, ",.:; ") 
 
for i = 1 to length(words) do 
    printf(1, "Word %d: %s\n", { words[i] }) 
end for 


See prompt_string and split_any

Jeremy

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu