Class Cube

java.lang.Object
  extended by Cube

public class Cube
extends java.lang.Object


Constructor Summary
Cube(java.lang.String s)
          Construct cube from string, each face of the cube is one character of the string, but "Q" is replaced by "Qu" in making a cube
Cube(java.lang.String[] faces)
          Construct cube from an array of strings where each entry of the array represents a face of the cube.
 
Method Summary
 java.lang.String getRandomFace()
          Return a random face of the cube, effectively "rolling" the cube and returning the value shown.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Cube

public Cube(java.lang.String[] faces)
Construct cube from an array of strings where each entry of the array represents a face of the cube.

Parameters:
faces - is array of values, one per face of cube

Cube

public Cube(java.lang.String s)
Construct cube from string, each face of the cube is one character of the string, but "Q" is replaced by "Qu" in making a cube

Parameters:
s - is string that is the source of values for the cube's faces
Method Detail

getRandomFace

public java.lang.String getRandomFace()
Return a random face of the cube, effectively "rolling" the cube and returning the value shown.

Returns:
a string representing one face of cube, the face is generated at random