Day 21. Putting It Together (Part II)

A just machine to make big decisions

Programmed by fellows with compassion and vision…

—Donald Fagen, “IGY” (The Nightfly, 1982)

Today, just as on Day 16, there is no single organizing topic, and there are no exercises; rather, we practice our Ruby skills by walking together through two projects.

The first project is an exploration of rudimentary artificial intelligence. We write a script that takes advantage of past “experience,” asks the user some questions about the current situation, and makes a decision—or more precisely, makes a prediction on which the user can base a decision.

The second project grows out of the discussion on Day 19 about online chat facilities. We had a pair of scripts that allowed ...

Get Sams Teach Yourself Ruby in 21 Days now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.