Skip to content

chadnash/first

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 

Repository files navigation

There are two implementations in simple.rb and allclasses.rb
Both can be run from test_robot the robot that is run is determined by the value
of TestRobot::@@RobotClass  valid values are  Robot or Robot2

Robot in simple.rb is uses
  case statements  which have the advantage that the set of alternatives can be easily compared.

Robot2 in allclasses.rb is an example of using double dispatching between the command,heading and the robot
  The purpose of this example to be the construction of more elaborate consistency checks for example I anticipated building
  random command sequence and then calculating a reversing command sequence and then seeing if the robot got back to the start.

  I did build random command sequences - include ones with errors.

I used the random command sequences to run the robots against each other for very many different command sequences

Originally I had testing capturing stdout and comparing this to what was expected. I changed this as I though it was overkill
on reflection stdout (and stdin) is what the system is supposed to deal with and as inadvertent debug puts would have broken the system
I now believe it to be a good idea..

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages