/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin
edit: oh, I got something:
/Users/JohnM/Desktop/word_chain2.rb: line 2: FILENAME: command not found
/Users/JohnM/Desktop/word_chain2.rb: line 6: NO_PROGRESS_CUTOFF: command not found
/Users/JohnM/Desktop/word_chain2.rb: line 10: PURE_PATTERN_MATCHING: command not found
/Users/JohnM/Desktop/word_chain2.rb: line 14: PROMPT_FIRST_WORD: command not found
/Users/JohnM/Desktop/word_chain2.rb: line 17: START_WORD: command not found
/Users/JohnM/Desktop/word_chain2.rb: line 23: syntax error near unexpected token `('
/Users/JohnM/Desktop/word_chain2.rb: line 23: `def parse_textfile(filename)'
#!/usr/bin/env ruby
That's the default terminal shell trying to execute the script rather than ruby.
try adding
Code:#!/usr/bin/env ruby
to the very top of word_chain2.rb
then try ./word_chain2.rb again
Awesome. It works phenomenally. Thank you. Now, is it possible to throw in something that prevents wildcar repeats after the first 10 combos? i.e. if the tenth combo was 3+0+1+2, the next combo cannot start with a 2.
Not sure I follow you
if one has [3012][3012]...{7 more times}...[3012] then the next sequence should NOT start with a '2' ? Nor should it start with anything BUT a '3' (continue the pattern)?
Is this the FIRST 10 combos, or ANY sequence of 10 combos?
Perhaps you should rephrase what you want (no promises that I'll do it anyway)
And because I'm curious, what is this whole thing for?
Not sure I follow you
if one has [3012][3012]...{7 more times}...[3012] then the next sequence should NOT start with a '2' ? Nor should it start with anything BUT a '3' (continue the pattern)?
Is this the FIRST 10 combos, or ANY sequence of 10 combos?
Perhaps you should rephrase what you want (no promises that I'll do it anyway)
And because I'm curious, what is this whole thing for?
1) This actually hurts your result chain (basically any restrictions in word choice will reduce the result size)
2) Your exception about the first 10 choices makes no difference to this implementation. Basically the program starts with the base word and starts chaining words together. If it hits a dead end, it backs up one step and tries a different path. If the program had time to actually finish it would have checked all possible branches, but because it stops after it hits a local maxima, earlier decisions in the path are never revisited to see if a better early choice would have made a difference. In other words, the earlier a decision is made on a step, the less likely that decision is to be re-evaluated for a better final result.
It's to cheat in an online flash game to impress/swindle friends. He said "make money", but how one does so in a game like this is tough to figure out. I couldn't find the original "help me cheat on games" thread, but there was this game and a few others, such as locating US cities on a map.
It's to cheat in an online flash game to impress/swindle friends. He said "make money", but how one does so in a game like this is tough to figure out. I couldn't find the original "help me cheat on games" thread, but there was this game and a few others, such as locating US cities on a map.
I guess sometimes it's more fun to talk others into doing reasonably involved coding to play a game for you rather than playing it yourself?
-Lee
All traces of that other thread have been removed.<snip>
To be fair(er) to the OP, after re-reading the initial thread the point was just impressing people, not making money or scamming them, which is less bothersome.
-Lee
Thanks.
However if you are doing it for a laugh or high score, let me know how it goes.
For me at least it makes it more of a waste of time than if you were just doing it for kicks or to learn something since you stand to benefit from it, but I don't.To be fair, I was directly asked what this was for and the way I saw it, if I hadn't implied that I was somehow gaining from this or that I just wanted it for kicks, nobody would bite because they might see it as a waste of their time.
That should just be like one line-item right?
For me at least it makes it more of a waste of time than if you were just doing it for kicks or to learn something since you stand to benefit from it, but I don't.
balamw said:Again I'd be far more inclined to help out if you actually tried something yourself.
Ok, what should I try?
./my_script.rb
#!/usr/bin/ruby
which ruby