Advertisement
Guest User

Untitled

a guest
Oct 24th, 2014
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.42 KB | None | 0 0
  1. public c l a s s
  2. LogoProgram {
  3. public s t a t i c void
  4. main( String [ ] args ) {
  5. Program p =
  6. new
  7. Program("Square" ) ;
  8. p . addInstruction ("REP" , 4);
  9. p . addInstruction ("FWD" , 100);
  10. p . addInstruction ("ROT" , 90);
  11. p . addInstruction ("END" , 1);
  12. i f
  13. (p . isCorrect ()) {
  14. p . start ( ) ;
  15. while
  16. ( ! p. hasFinished () ) {
  17. Instruction instr = p. getNextInstr ( ) ;
  18. System . out . println ( instr . info () ) ;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement