Pig

Pig

pig.rb

Pig is one of the lesser-known games of our time, but nonetheless, a fun one to play. All it requires is a six-sided die. The goal of the game is to reach 100 points by adding the totals of your throws. You can throw the die as many times as you want during your turn, but if you roll a 1, you lose all of the points gained during that turn and then your opponent gets a chance to rack up points. Pig is a simple game, but it is deceptively difficult to win.

The Code

 puts "\n\n\n\n\n\n\nWelcome to the game PIG!" puts "\n----INSTRUCTIONS----" puts "The object of the game is to reach 100 points." puts "*** Be careful, if you roll a 1 you lose ...

Get Wicked Cool Ruby Scripts 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.