Developing a small project:
Note: While being a project this highly aimed toward scripting
I've gotten this idea that we, as a community, should develop a small project.
It's a great way to learn Ruby as you'll get input for work as well as you'll have to read other's work to give output.
Getting to see different solution to a problem is far harder done alone.
The goal is to create, well...
Think of a box or a window which contains text. You can add lines to this text field.
When you do this the new lines will be added at the bottom moving the previous text upwards.
You can think of it as a queue. New people get into it at the end while the first in line exits.
The first-in-first-out principle ya know.
The user must be able to specify when the text field is full.
When the text field is full the first lines added will be removed accordingly to new lines added.
That is the goal.
Now first of all we'll have to choose a data structure.
This will be the first task, a research task. It is important to be able to search properly.
You must find a simple, yet quite efficient data structure that fits our needs.
Don't touch algorithms with running bigger than O(n^2) if you manage to find one. - I know, not correct notation
Hint: Avoid 'Fibonacchi Heaps'