Programming 1

Blockly

Challenge 1 Solution:

Maze.moveForward();
Maze.moveForward();

URL:http://blockly-demo.appspot.com/static/apps/maze/index.html?lang=en&level=1&skin=1#ykthek

Challenge 2 Solution:

Maze.moveForward();
Maze.turnLeft();
Maze.moveForward();
Maze.turnRight();
Maze.moveForward();

URL:http://blockly-demo.appspot.com/static/apps/maze/index.html?lang=en&level=2&skin=1#j3xa87

Challenge 3 Solution:

while (true) {
Maze.moveForward();
}

URL:http://blockly-demo.appspot.com/static/apps/maze/index.html?lang=en&level=3&skin=1#mi7osx

Challenge 4 Solution:

while (true) {
Maze.moveForward();
Maze.turnLeft();
Maze.moveForward();
Maze.turnRight();
}

URL:http://blockly-demo.appspot.com/static/apps/maze/index.html?lang=en&level=4&skin=1#n7i6iy

Challenge 5 Solution:

Maze.moveForward();
Maze.moveForward();
Maze.turnLeft();
while (true) {
Maze.moveForward();
}

URL:http://blockly-demo.appspot.com/static/apps/maze/index.html?lang=en&level=5&skin=1#wp2gwn

Challenge 6 Solution:

while (true) {
Maze.moveForward();
if (Maze.isPathLeft()) {
Maze.turnLeft();
}
}

URL: http://blockly-demo.appspot.com/static/apps/maze/index.html?lang=en&level=6&skin=1#7arw9p

Challenge 7 Solution:

while (true) {
Maze.moveForward();
if (Maze.isPathRight()) {
Maze.turnRight();
}
}

URL:http://blockly-demo.appspot.com/static/apps/maze/index.html?lang=en&level=7&skin=1#ujjxpx

Challenge 8 Solution:

while (true) {
Maze.moveForward();
if (Maze.isPathLeft()) {
Maze.turnLeft();
}
if (Maze.isPathRight()) {
Maze.turnRight();
}
}

URL:http://blockly-demo.appspot.com/static/apps/maze/index.html?lang=en&level=8&skin=1#2hih6q

Challenge 9 Solution:
while (true) {
Maze.moveForward();
if (Maze.isPathLeft()) {
Maze.turnLeft();
} else {
Maze.moveForward();
}
if (Maze.isPathRight()) {
Maze.turnRight();
}
}

URL:http://blockly-demo.appspot.com/static/apps/maze/index.html?lang=en&level=9&skin=1#xsubx6

Challenge 10 Solution:

while (true) {
if (Maze.isPathForward()) {
Maze.moveForward();
} else {
Maze.turnLeft();
}
if (Maze.isPathRight()) {
Maze.turnRight();
}
}

URL:http://blockly-demo.appspot.com/static/apps/maze/index.html?lang=en&level=10&skin=1#dnmpsc

 

  1. What does if mean? When does it come in handy? 2+ sentences

If means that an event will occur if and only if the condition is implied and the even happens. This comes in handy when you want a block to come into play only after another has occured.

  1. What does if else mean? When does it come in handy? 3+ sentences

An event occurs only if another event happens. If it doesn’t, whatever is in the block will happen. It comes in handy when you need to make the character turn a certain direction, but not every time you happen to come up the direction.

  1. What does repeat mean? When does it come in handy? 2+ sentences

Repeat means to have something happen again and again. It comes in handy when you need an event/block to occur multiple times. You don’t have to add the block over and over again.

Leave a comment

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

Blog at WordPress.com.

Kaneisha York's E-Portfolio

It Problem solving

Rosaly Garcia

Hello! ( ´ ▽ ` )ノ Welcome To My ePortfolio!

Maya Price

ePortfolio

gabe35velez

2Big 2Strong 2Fast 2Good

%d bloggers like this: