RPaD- Coding in Javascript

How do we Communicate?

Today we’ll continue playing with coding.

As a class, we will discuss complex and simple behaviors, algorithms, and flow charts.

Part 1

We are going to use a couple Javascript learning modules from Code Avengers to get a bit more into coding. Last week, we talked about iteration. That is, the ability to tell a program to repeat a specific step x number of times, where x = the number within the parenthesis. For example with Karel; move(4); would cause Karel to move four times.

In the Karel module, the programming was pretty simple, you just gave it a command and it automatically knew you were talking to Karel. However, in the module from Code Avengers, you’ll need to identify that your command is for the robot for each command. This is similar to our simulation last class where we built a peanut butter sandwich. I would constantly move the wrong arm or hand if you didn’t specifically identify what you wanted me to move.
CodeAvengers

I’ve annotated this screenshot of Code Avenger’s interface with notes I think you will find helpful. Click on the image on the right to enlarge it.

Code Avengers > Javascript > Robot Challenge 1
In the first challenge you only have to tell the robot to move and turn in order to get to its destination.

Post a screenshot of your screen upon the completion of Robot Challenge 1, part 5. To take a screenshot, hold command, shift, and 3. Then upload the screenshot to your blog.

Part 2

If you haven’t already, play Save my Robotos. It will help prepare you for the next set of coding activities on Code Avengers.

Part 3

The different levels in Robot Challenge 1 didn’t really get harder, they just got longer. Robot Challenge 2 actually gets more complex as it asks you to utilize new programming structures.

Code Avengers > Javascript > Robot Challenge 2
Robot Challenge 2 starts off pretty simple, except now you have to write a code that will get two robots to their destination. As you complete the different activities in Robot Challenge 2, you’ll be introduced to the conditional “if” statements. Your robot will even utilize a sight sensor to aid in this.

Post a screenshot of your screen upon the completion of Robot Challenge 2, part 5. To take a screenshot, hold command, shift, and 3. Then upload the screenshot to your blog.

Part +

There are two more levels of Robot Challenges on Code Avengers. These start to get pretty complicated. You might not be able to complete them all. Post a screenshot of how ever far your able to get on your blog.

Code Avengers > Javascript > Robot Challenge 3
Robot Challenge 3 makes use of “while” loops and more conditional “if” statements.

Code Avengers > Javascript > Robot Challenge 4
Robot Challenge 4 continues these concepts but also introduces another sensor (the distance sensor).

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s