Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public c l a s s
- LogoProgram {
- public s t a t i c void
- main( String [ ] args ) {
- Program p =
- new
- Program("Square" ) ;
- p . addInstruction ("REP" , 4);
- p . addInstruction ("FWD" , 100);
- p . addInstruction ("ROT" , 90);
- p . addInstruction ("END" , 1);
- i f
- (p . isCorrect ()) {
- p . start ( ) ;
- while
- ( ! p. hasFinished () ) {
- Instruction instr = p. getNextInstr ( ) ;
- System . out . println ( instr . info () ) ;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement