top of page

Week 6: Hammering Down the Code

Last night, Samm put together the modular, template functions we need for Daedalus' logic code. Today, she will be filling in the template with code that will actually call those functions something. Meanwhile, I will be explaining the functions Samm has put together so far.

The first part of the code checks the boundaries; it makes sure that Daedalus doesn't run off the board. Since our board is 4x4, this makes sure that the x and y of Daedalus' position stays between 0 and 3. As a result it'll know it's at some boundary if its position is (0,1) or (3,0).

Here, in the first part, the functions tell Daedalus what to do when it finds either a glimmer, a stench, or a breeze. In all the cases, Daedalus will pop up a message "Found glimmer/stench/breeze!". Afterwards it'll update the surrounding squares with whatever potential thing it senses and move according to whether or not it's a glimmer/stench/breeze. In the second part, it cover for when Daedalus has confirmed the locations of the Gold, Wumpus, and a pit. Once it finds this info, again, it will move depending on what it has found.

This code processes the inputs Daedalus is given and updates the surrounding accordingly. For example, 4 will be inputted into Daedalus and it'll know that, in its current location, it is near gold and update its surroundings with this information. The next part of the code decides how Daedalus will move. This code will only allow for Daedalus to move to a safe square. Running the code, Daedalus will be able to figure out its options (North, South, East, or West) and move accordingly; if it has more than one option it will randomly pick one of them. The next part updates its current location after it moves. If it moves North, the current y value will be increased by 1. The last part tells Daedalus how to move North, South, East, or West with the movement code previously established.

That's the code Samm is starting from today. With the help of Randy, they are currently putting all the functions together.

We will be meeting again at 6 pm to make last minute adjustments and allow time in case Daedalus decides to throw a tantrum.

 

It's 6:15. Samm and Randy are still working on the code. They are currently working out the issue of the random selection of movement previously mentioned. Theoretically, if Daedalus was choosing his movements to safe squares randomly, it could move between the same two squares for eternity or, within the context of the trial, a long time.

It seems the consensus is that the chances of that happening is very low. Considering that the rest of the code still needs work, this problem seems rather small at the moment. The errors ran all the way up to 7:00 pm.

Updates in the next blog post.


bottom of page