This program allows you to make and modify linked lists in Ruby. There is a live version on replt.it.
A simple aim, I just had to use OOP to make linked lists. It needs to have the same behaviours as a typical linked list. Nothing much to say. On to tasks!
There was just one main taks, but the optional tasks are interesting. Some of these I may come back to later, as I know how to implement them. Instead my focus was on making an interactive program with the essentials.
- Implement linked list behaviour
- Implement the to_s recursively
- (Optional) Add an interface
- (Optional) Add commands
- [] (Optional) Add "insert at" and "remove at" functions
There was nothing in particular used here. Just information about linked lists. The basic idea is that each "node" has a variable that references/points to anoher node. You can read more generally about linked lists in Ruby on sitepoint.