Lab 9: Game of Fifteen

March 20, 2012

Now available for download, this is the Game of Fifteen. You probably know it from childhood, but if not it’s simple to understand. The goal is to get all the letters in order. All you need to do is type the letter of the piece you want to slide. It’s the best game ever! Read more »

Google CSSI

March 19, 2012

Seniors attending a 4-year school and planning to major in Computer Science, Computer Engineering, Software Engineering, or similar should apply to Google’s Computer Science Summer Institute. It’s a 3-week, all expenses paid program at the Google campus that will give you an amazing head start on your freshman year.

The application deadline is Friday, April 20, 2012.

Lunch Meeting Today

March 19, 2012

A couple weeks ago at the Digital Media & Learning Conference I met David Preston, a teacher in central California. We found that we have a lot in common, including students who are creating games. Since meeting new people is a great way to get new ideas and perspectives, we decided to hold an online conference for students today (Tuesday, March 19) at lunch.

To make introductions easier and give the conversation some shape/structure, we agreed to look at the article “Why Angry Birds is so Successful and Popular” by Charles Mauro and the video
Inventing on Principle by Bret Victor. Please check these out and come to room 102 at lunch on Tuesday!

RPS Contest Wrap-up

March 14, 2012

Congratulations to Michael on his JimmyCritter win! Here is a picture of the winning critter:

Now that everyone has had a chance to look at the source, send an email to Mr. Chun with the following information:

  1.  The name of your subclass
  2. A description of the movement strategy you used
  3. A description of the throw (fight) strategy you used
  4. An analysis of what you would change or improve in your subclass if there was a rematch
  5. Any other thoughts or feedback you have about the contest

Send this email by the end of the class period.

 

Gameboard

March 13, 2012

Now that you’ve seen the demonstration of what they do, here are the two blocks we’re trying to create today:

As a starting point, it will be helpful if you first build:

After you have both blocks working, you should be able to see something like:

Remove From List

March 9, 2012

Here’s the code we looked at that almost works:

Our goal is to make the following block work correctly for all lists!

What happened before? getMatchRecord

March 8, 2012

In your fight method, this is a pretty useful line of code:

ArrayList<RPSMatch> matchRecord = RPSWorld.getMatchRecord(opponent.getClass());

Then you can go through the matchRecord array and figure out whatever statistics you think are important. Beware, RPSWorld.getMatchRecord will return null if the opponent class has not yet played any matches!

List of Names

March 7, 2012

The following script is intended to keep track of the names of the players of a game, but it has a bug! Find and fix the bug. The code is available in the pickup folder, named BuggyReadingList.ypr. Once you are done with it, you may find it useful in your other projects!

After you fix that problem, we want to make the sprite read all of the names from our players list. This is a very common type of problem when dealing with lists: we want to do the same thing for each item in the list. To tackle this problem, we are going to use a variable called index to keep track of the position of the element in the list we are processing.

Once you get the script above to work, try to make a script that will say all of the player names together, with the appropriate commas, spaces, and the word “and”, as shown below.

If you didn’t already do so, wrap up your code into a single block, so it works like this:

It might be nice to even make a more general version like:

RPSCritter Competition

March 6, 2012

Try your hand (no pun intended) against the New York Times interactive Rock-Paper-Scissors AI. While random play would always result in random winners (with the overall score expected to be even in the long run), knowing an opponent’s tendencies allows you to develop a strategy.

Read more »

Predicates: Between

March 5, 2012

Create a new predicate block that determines if a number is between two other numbers. The block should return true if the first number is between the two numbers or if it is equal to either of the numbers.

Older »