Breaking News: Cookie Monster Conquers All

Jan 29, 2005 22:55

In an AP Computer Science textbook:
"Write a program in which Cookie Monster finds the optimal path..."

What have I gotten myself into?

Leave a comment

Comments 3

mozzi February 1 2005, 00:30:27 UTC
Pizza parties. :]

Reply


zimzat February 1 2005, 03:05:45 UTC
I want to see more about this program you're supposed to write. You've gotten my interest because I've read a few path-finder and line-of-sight algorithems.

Reply

soccerfreak240 February 1 2005, 03:55:11 UTC
Its actually not that interesting. Its a path finder.

Summary: the cookie monster is on a grid full of cookies (lucky bastard). For some reason, he can't eat all of them, because he can only move down or right (I'm gonna assume he has some injury or something or is too stupid to just eat them all). Starting in the top left corner, he must move to the lower right, eating as many cookies as possible. Some spots on the grid are marked with a -1 which represents a barrel. Barrel's are bad because they're not cookies, therefore, he cannot go to a square with barrels. The goal is to find the path which gives the most cookies and print out how many cookies it gives out (not required to print out the path). We had to use stacks and queues to do it. not that bad though.

Reply


Leave a comment

Up