Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Ancient Civilization Robot Program: Decoding Keystone Combinations - Prof. Andrew Ray, Lab Reports of Computer Science

A lab assignment where students are tasked with creating a program for a lego robot to read and execute ancient programs that determine the correct number of red, white, and black keystones to place on pedestals in order to deactivate traps in treasure rooms. The ancient programs consist of linear sequences of action and informational tiles that manipulate memory values and perform commands. Students must use at least three classes in their solution: one for representing operations, one for storing the computer's state, and one for reading and performing the operations.

Typology: Lab Reports

2009/2010

Uploaded on 02/25/2010

koofers-user-9gy
koofers-user-9gy 🇺🇸

5

(1)

10 documents

1 / 3

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
ITEC 120 Lab 24 and 26
Created'by'Dr.'Ray'
'
Reference links:
http://www.radford.edu/~aaray/Robot.java
http://www.radford.edu/~aaray/robotDoc/Robot.html
'
This'is'a'lab'that'will'take'two'weeks'to'finish,'will'count'for'two'lab'report'grades,'
and'will'also'count'as'a'homework'assignment'(all'members'of'your'group'will'
share'the'same'grade'unless'someone'does'not'adequately'participate'in'creating'
the'solution).'''
'
Your'group'will'need'to'demonstrate'that'your'program'works'by'the'end'of'the'
week'13'Thursday'lab,''or'you'will'get'a'0'for'both'lab'assignments'and'the'
homework'assignment.'
'
Problem 1: Treasure Hunter
The legendary archaeologist Dr. Jones has discovered a long lost civilization that left
several storehouses of treasure. The only problem is that ancient traps protect each
treasure room. In order to deactivate the traps, Dr. Jones theorizes that you place the
right amount of red, white, and black keystones on corresponding pedestals to deactivate
the trap. The skeletal remains of his predecessor point out that if you put the wrong
combination of stones on the pedestals, bad things happen.
In order to find the right combination of red, white, and black keystones the ancient
civilization left groups of red, black, and white tiles in their pyramids that contain the key
to determining the right number of red black and white keystones to use on the pedestal.
After long hours of studying, Dr. Jones has discovered the ancient civilization built what
we would call primitive computer programs to calculate the right number of red, white,
and black stones to put on each pedestal. Given the condition of the storehouses of
treasure and all of the traps the ancient civilization left, it is safer for a robot to determine
what the right number of stones to put on the pedestals should be instead of sending a
human to do it.
The ancient computer that runs the programs stores three integer values in memory. Each
value is referred to by color (red, white, or black) and start at 0 when the program begins.
These values can be printed (to indicate what to put on the pedestal), or can be
manipulated by different commands. The ancients also use a numbering scheme to
provide numeric values for each color. The color red stands for 1, the color black stands
for 2, and the color white stands for 3.
The programs that the ancients used consisted of using red, white, or black tiles in a
linear line. Depending on where the tiles are in the line, their meaning changes. Tiles
can be either action or informational. Tiles are approximately 1.8 inches tall and 8.5
inches wide.
pf3

Partial preview of the text

Download Ancient Civilization Robot Program: Decoding Keystone Combinations - Prof. Andrew Ray and more Lab Reports Computer Science in PDF only on Docsity!

ITEC 120 Lab 24 and 26

Created by Dr. Ray Reference links: http://www.radford.edu/~aaray/Robot.java http://www.radford.edu/~aaray/robotDoc/Robot.html This is a lab that will take two weeks to finish, will count for two lab report grades, and will also count as a homework assignment (all members of your group will share the same grade unless someone does not adequately participate in creating the solution). Your group will need to demonstrate that your program works by the end of the week 13 Thursday lab, or you will get a 0 for both lab assignments and the homework assignment. Problem 1 : Treasure Hunter The legendary archaeologist Dr. Jones has discovered a long lost civilization that left several storehouses of treasure. The only problem is that ancient traps protect each treasure room. In order to deactivate the traps, Dr. Jones theorizes that you place the right amount of red, white, and black keystones on corresponding pedestals to deactivate the trap. The skeletal remains of his predecessor point out that if you put the wrong combination of stones on the pedestals, bad things happen. In order to find the right combination of red, white, and black keystones the ancient civilization left groups of red, black, and white tiles in their pyramids that contain the key to determining the right number of red black and white keystones to use on the pedestal. After long hours of studying, Dr. Jones has discovered the ancient civilization built what we would call primitive computer programs to calculate the right number of red, white, and black stones to put on each pedestal. Given the condition of the storehouses of treasure and all of the traps the ancient civilization left, it is safer for a robot to determine what the right number of stones to put on the pedestals should be instead of sending a human to do it. The ancient computer that runs the programs stores three integer values in memory. Each value is referred to by color (red, white, or black) and start at 0 when the program begins. These values can be printed (to indicate what to put on the pedestal), or can be manipulated by different commands. The ancients also use a numbering scheme to provide numeric values for each color. The color red stands for 1, the color black stands for 2, and the color white stands for 3. The programs that the ancients used consisted of using red, white, or black tiles in a linear line. Depending on where the tiles are in the line, their meaning changes. Tiles can be either action or informational. Tiles are approximately 1.8 inches tall and 8. inches wide.

Action tiles cause some change to happen in the program. For action tiles, white stands for update a value in memory, black stands for move, and red means perform a command. If an action tile is white, then the next two tiles will be informational tiles. You will store the value represented by the second informational tile in the memory slot represented by the first informational tile. Example white action tile sequence: White Store value Red Store in the red variable Black The value is 2 Figure 1. White action tile scenario If an action tile is red then it stands for perform a command. The next tile will be informational and will denote what command to apply. If the next tile is black, then print out the values of the variables for the computer and stop the program. If the next tile is red or white, then read in the next two tile colors. If the first of the three is red, then it is a multiply operation; if the first of the three is white then the operation is addition. The second tile represents what variable to add/multiply and where the result should be stored. The third tile gives the second operand to the addition or multiplication. Example red action tile sequence: Red Command Red Multiply White Variable 1 Black Variable 2 perform white = white*black Figure 2. Red action tile scenario If an action tile is black then it has one informational tile associated with it. That informational tile says which direction to move. If the informational tile is white then move back two tiles. If the informational tile is red, then move forward one tile. If it is black, then turn around. Example black action tile sequence: Black Command White Move backwards two tiles Figure 3. Black action tile scenario After each action tile and its related informational tiles, another action tile will be present. A program continues until the print command sequence is encountered (a red tile followed by a black tile).