Skip to content

Files

Latest commit

e54adb1 · Mar 20, 2018

History

History

color-ghost

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Mar 20, 2018
Mar 20, 2018

Color Ghost

View on Codewars

Color Ghost

Create a class Ghost

Ghost objects are instantiated without any arguments.

Ghost objects are given a random color attribute of white" or "yellow" or "purple" or "red" when instantiated

ghost = new Ghost();
ghost.color //=> "white" or "yellow" or "purple" or "red"
ghost = new Ghost()
ghost.color #=> "white" or "yellow" or "purple" or "red"
ghost = Ghost.new
ghost.color  #=> "white" or "yellow" or "purple" or "red"
ghost = Ghost()
ghost.color  #=> "white" or "yellow" or "purple" or "red"
Ghost ghost = new Ghost();
ghost.getColor(); //=> "white" or "yellow" or "purple" or "red"
Ghost ghost = new Gost();
ghost.GetColor(); // => "white" or "yellow" or "purple" or "red"

Timeline

  • Created: 2014-08-17
  • Published: 2014-08-17
  • Approved: 2014-08-27
  • Completed: 2015-05-09