|
1 |
| -<!DOCTYPE html><htmllang="en"><head><metacharset="utf-8"><metaname="viewport"content="width=device-width,initial-scale=1,user-scalable=0"><title>Lightbot</title><linkrel="icon shortcut"type="image/x-icon"href="/favicon.09aa0899.ico"><linkhref="/index.51e3ad98.css"rel="stylesheet"><linkhref="/index.20166f71.css"rel="stylesheet"><linkhref="/lightbot/index.afc4a0bc.css"rel="stylesheet"></head><bodyclass="page-lightbot"><divclass="navbar navbar-inverse"><divclass="navbar-inner"><divclass="container"><divclass="collapse nav-collapse"><aclass="brand"href="/"><spanclass="logo"></span></a><ulclass="flex flex-wrap nav"><li><ahref="/"><iclass="icon-newspaper"></i><span>Home</span></a></li><li><ahref="/igpc/"><iclass="icon-power-cord"></i><span>igpc</span></a></li><liclass="hidden md:list-item"><ahref="/lightbot/"><iclass="icon-power-cord"></i><span>Lightbot</span></a></li><liclass="hidden md:list-item"><ahref="/docs/"><iclass="icon-arrow-right"></i><span>Getting Started</span></a></li></ul></div></div></div></div><divclass="main s-mini-container"><divclass="container mx-auto"><divclass="main-content"><divclass="title-header"><spanclass="tag-line">Lightbot</span></div><div><h2class="first">Solve Puzzles using Programming!</h2><p> LightBot is a puzzle game based on coding; it secretly teaches you programming logic as you play!</p><pstyle="background:#ffe;border-radius:10px;padding:10px;font-size:24px"><b>Programming</b>, or<b>Coding</b>, is simply the way people tell a computer what to do using instructions that the computer understands.</p><h2>Rules for Programming Lightbot</h2><p> In the game, the Lightbot is programmed by arranging icons representing discrete actions onto a grid. The possible actions are:</p><p><imgsrc="/instructions.747472f8.png"></p><prestyle="max-width:480px"> |
| 1 | +<!DOCTYPE html><htmllang="en"><head><metacharset="utf-8"><metaname="viewport"content="width=device-width,initial-scale=1,user-scalable=0"><title>Lightbot</title><linkrel="icon shortcut"type="image/x-icon"href="/favicon.09aa0899.ico"><linkhref="/index.51e3ad98.css"rel="stylesheet"><linkhref="/index.20166f71.css"rel="stylesheet"><linkhref="/lightbot/index.afc4a0bc.css"rel="stylesheet"></head><bodyclass="page-lightbot"><divclass="navbar navbar-inverse"><divclass="navbar-inner"><divclass="container"><divclass="collapse nav-collapse"><aclass="brand"href="/"><spanclass="logo"></span></a><ulclass="flex flex-wrap nav"><li><ahref="/"><iclass="icon-newspaper"></i><span>Home</span></a></li><li><ahref="/igpc/"><iclass="icon-power-cord"></i><span>igpc</span></a></li><liclass="hidden md:list-item"><ahref="/lightbot/"><iclass="icon-power-cord"></i><span>Lightbot</span></a></li><liclass="hidden md:list-item"><ahref="https://cs.coursemo.com/cs0478-book/getting-started.html"><iclass="icon-arrow-right"></i><span>Getting Started</span></a></li></ul></div></div></div></div><divclass="main s-mini-container"><divclass="container mx-auto"><divclass="main-content"><divclass="title-header"><spanclass="tag-line">Lightbot</span></div><div><h2class="first">Solve Puzzles using Programming!</h2><p> LightBot is a puzzle game based on coding; it secretly teaches you programming logic as you play!</p><pstyle="background:#ffe;border-radius:10px;padding:10px;font-size:24px"><b>Programming</b>, or<b>Coding</b>, is simply the way people tell a computer what to do using instructions that the computer understands.</p><h2>Rules for Programming Lightbot</h2><p> In the game, the Lightbot is programmed by arranging icons representing discrete actions onto a grid. The possible actions are:</p><p><imgsrc="/instructions.747472f8.png"></p><prestyle="max-width:480px"> |
2 | 2 | forward light left right jump P1 P2</pre><ul><li><code>forward</code> - Lightbot moves forward one step if this does not take it off the grid and the next tile is at the same level as the current tile.</li><li><code>light</code> - Lightbot lights up the tile it is standing on if it has a deep blue color.</li><li><code>left</code> - Lightbot turns left (counter-clockwise) 90 degrees but stays on the current tile.</li><li><code>right</code> - Lightbot turns right (clockwise) 90 degrees but stays on the current tile.</li><li><code>jump</code> - Lightbot jumps forward one step if the next tile is either one level higher or any number of levels lower than the current tile.</li><li><code>P1</code> - Lightbot starts executing the commands shown in the PROC1 area. Once it is done, it returns back to where it left off in the command sequence (just after the P1 command).</li><li><code>P2</code> - Lightbot starts executing the commands shown in the PROC2 area. Once it is done, it returns back to where it left off in the command sequence (just after the P2 command).</li></ul><h2>Representing Lightbot Programs Textually</h2><p> Although programs can be written in a variety of notations — including graphical ones, like in the Light-Bot game — it is most common to use represent programs textually.</p><p> For example, consider the Lightbot puzzle with its solution program and the corresponding text file<b>shown in Figure 1 below</b>.</p><tableclass="border-collapse my-table-1"><tbody><tr><td><imgsrc="/stage-5-1.50db4d1b.png"height="400"width="550"></td><td><preclass="no-background">
|
3 | 3 | Name: Larry Xu
|
4 | 4 | Stage: 5-1
|
|