Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need help with this c++ program. 16.14 Homework 10a : Partial Lightbot Interpreter The game Lightbot https://en.wikipedia.org/wiki/Lightbot is a popular game that teaches programming

I need help with this c++ program.

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

16.14 Homework 10a : Partial Lightbot Interpreter The game "Lightbot https://en.wikipedia.org/wiki/Lightbot is a popular game that teaches programming concepts. In the game, players write programs in a simple language to direct a robot around a 2D grid and switch on lights at specific grid cells In this program, you will write an interpreter for a language similar to the Lightbot language. The interpreter will take as input an initial board configuration, including the location of the robot (the robot always starts facing to the right), and a program. It must then compute the resulting board configuration, and determine whether the bot will win the level or not (by switching on all the lights and stopping without dying). "Switching on a square toggles the light if there is one, and does nothing otherwise. Language Commands: Left rotate left 90 degrees rotate right 90 degrees go forward one square toggle light if there is one in the current square Right Forward Switch If Condition Statements Check the condition. If it is true, execute the statements, otherwise skip to after the close) Possible conditions: forwardOpen, backOpen, leftOpen, rightOpen forwardClosed, backClosed, leftClosed, rightClosed hasLight, lightOn, lightoff 16.14 Homework 10a : Partial Lightbot Interpreter The game "Lightbot https://en.wikipedia.org/wiki/Lightbot is a popular game that teaches programming concepts. In the game, players write programs in a simple language to direct a robot around a 2D grid and switch on lights at specific grid cells In this program, you will write an interpreter for a language similar to the Lightbot language. The interpreter will take as input an initial board configuration, including the location of the robot (the robot always starts facing to the right), and a program. It must then compute the resulting board configuration, and determine whether the bot will win the level or not (by switching on all the lights and stopping without dying). "Switching on a square toggles the light if there is one, and does nothing otherwise. Language Commands: Left rotate left 90 degrees rotate right 90 degrees go forward one square toggle light if there is one in the current square Right Forward Switch If Condition Statements Check the condition. If it is true, execute the statements, otherwise skip to after the close) Possible conditions: forwardOpen, backOpen, leftOpen, rightOpen forwardClosed, backClosed, leftClosed, rightClosed hasLight, lightOn, lightoff

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database In Depth Relational Theory For Practitioners

Authors: C.J. Date

1st Edition

0596100124, 978-0596100124

More Books

Students also viewed these Databases questions

Question

Find the derivative of the function. f(x) = ln x/ x 2 + 1

Answered: 1 week ago