Posts Tagged "Ruby"

Small High-Low Game Example in Ruby

Well it has been awhile since I made an entry so I thought I would make one while also answering someone's question. The user named "Cunningham" asked about an example high-low number guessing game to get started with learning Ruby. The game is essentially guessing the random number generated by the computer to see how quick you can guess it. The computer picks a random number in a range of ...

Reflective N-bit Binary Gray Code Using Ruby

So what is behind the theory of binary gray code? It was named after Frank Gray and is a numerical system where each successive value differs from the one before it by one bit value. It is like counting in binary, but in binary counting a step may require changing two bits. For instance going from 1 (01) to 2 (10) would involve changing the most significant value 1 ...

Student Grades Using Ruby

A lot of people new to the programming game usually run across the grade book style of application at some point. The reason it is assigned as a beginner level project is that it is an easy way to show you how to use objects, how to use an array of objects, or more precisely how to use a collection. We here at DIC have seen variations of this project ...

Page Scraping Links with Ruby

Tinkering around with Ruby I figured I would write up a project that involved a little of everything a common Ruby program might have. A little sockets, a little class creation, array handling etc. The only thing I didn't include was a module but you could easily build one in if you like. The result was a nice little project which scrapes links from a given page. Ruby is gaining ...