Class Die
In: karel/die.rb
Parent: Object

Creates a die object with any number of faces. If you roll a die you get a random integer between 1 and the number of faces. You can create a physically impossible die with this, of course, with, say, seven faces.

Methods

new   roll  

Public Class methods

Create a new die with the specified number of faces

Public Instance methods

Roll the die to get a random integer between 1 and the number of faces.

[Validate]