So I’ve been up reading all night, my eyes are aching… I’ve got Hello
World! down pretty good, and I can make it repeat a few times… lol No
biggie there though, I’ve done that in C++ before. However Ruby makes me
feel like I can actually do this programming stuff… If I just knew what
the different functions did.
I’ve got an idea for a ¿script? I want written, but I’m not quite sure
how to get it done. I can’t seem to find a solid list of all the
¿functions? I’ll need to be using, so I just keep guessing. I’ve even
tried if/then statements hehe.
There’s two parts to what I need this ¿script? to do… Second part
doesn’t matter if the first part doesn’t get on track, so let’s deal w/
it first. What I need is… A 2-6 letter word generating program that
will save the words produced to a text file, neatly separated by
something like a comma or colon, something Ruby will be able to read at
a later date w/o separation issues.
I want to start out with double A’s and end up with 6x Z’s, or as close
to that but with full words…
On a side note, I found a script on another site someone else was
working on towards a similar end… However it wasn’t completed to the
specifications that the person wanted, nor I want, and I can’t even get
the thing to run. That may be because I found it on a mac site and I’m
running windows, idk… I forgot to check n see what OS the OP of that
thread was running, maybe someone here can shed some light on this. Tell
me if it’s a mac script, if not what’s going wrong, if so can it be
edited to work for windows? Any help would be greatly appreciated, even
if it’s just telling me what some of the functions mean/do and if
they’re windows/mac functions.
I’m sure anyone who reads this is wondering what I want this sorda
program for, so I’ll tell you… It’s for a game, I want it to select
names on a very old game. 99.95% of the names on this game are taken,
and I’m hoping to get lucky and snag a couple decent ones with this
program if I can get it running. It’s an online game ofc, and the cooler
the name you have the cooler you look ^.^ Just wanted ya to know I
wasn’t tryna make a brute force or any kinda cheat lol
If you installed the reference implementation at
“http://www.ruby-lang.org”, you will find a Documentation folder in the
Start:Ruby193-pxxx folder in your Windows Start menu. This will include
a help file that documents the API of the core and standard libraries,
which includes all of the basic methods and classes), and a PDF called
“The Book of Ruby”, which is a Guide to learning the language and the
most-used core APIs.
The bad news is that all Ruby documentation is crap. Rife with:
Tutorials that only allow you to recreate the examples without any
knowledge of how to expand on them.
Erroneous and deprecated information.
Incomplete information and bad presumptions by the author as to how
everyone ought to program.
And, worst of all, a complete disregard for how each element is
INTENDED to be used. They simply tell you the name, input, and output
with no clue as to why it exists or was implemented in that fashion to
In other words, the same as for any other language.
The good news is: Your project is exactly the type of algorithm Ruby was
designed to implement.
Look up the String class in the API helpfile and scroll down to the
succ() or next() methods (Truly awful names). That method will increment
the value of your string a-z from the last character to the first,
preserving case. So ‘zz’.next returns ‘aaa’.
Using the record separator variable “$=‘:’” with the print() and
gets() methods will easily write and read words separated by the ‘:’
That should get you rolling downhill into freeway traffic in no time.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.