some sample ruby code and tutorial

User avatar
cpg
Administrator
Posts: 2618
Joined: Wed Dec 03, 2008 7:40 am
Contact:

some sample ruby code and tutorial

Postby cpg » Thu Jan 15, 2009 10:29 pm

i got some comments from people in the community who wanted to get on the ground floor of ruby programming.

my all time favorite ruby tutorial is Brian Schröder's ruby course (PDF here).
the tutorial does not tell you that using the ruby interpreter (irb) is the best thing to run via the examples.

to test the git repo flow, and to put some simple code out there, i committed source code in the git repo (under etc/) to show some less simple code.

i developed this with my kids while i was attempting to show them about programming (in ruby) over the last holidays, to see how they liked it.

it's something simple: a blackjack game, but it can also simulate games with different strategies. my system can run up to 4000 games a second. from the README:
This is a BlackJack Game and simulator written in
ruby as I was showing my kids what programming was like.

The folder is "ready to use" as a Netbeans project.

The program can run in interactive mode and
also in simulation mode of one player with a
programmable strategy playing against the house.

My machine can simulate about 4000 games per second
in simulation mode.

You can see some sample output from simulation in sample-output.csv and sample-output.xls (same data, with a nice graph)

Carlos
My HDA: Intel(R) Core(TM) i5-3570K CPU @ 3.40GHz on MSI board, 8GB RAM, 1TBx2+3TBx1

Who is online

Users browsing this forum: No registered users and 53 guests