top of page
Search
  • ncampanelli0

Assignment 3

I lost the code to my original project and I found out at 12am on the same day this is being posted, long story short I got stuck doing other things and when I finally got the time to fix up my code to make sure everything was exactly as I wanted it, I went to load it and it was gone. I learned a very good lesson, if you don’t make an account on repl.it, despite the fact that the word “saved” is typed out next to a link it gives you to load up your code at a later point in time, it deletes your project, go figure...


The major difference between the two was the original made use of the speaker (to play/stop the opening of Tetris), the second substitutes the use of the speaker in favor of displaying a looping true/false message on the microbit itself. Programmatically speaking the original made use of Object Oriented Programming (class, functions and main) whereas the new one was quickly written with linear logic (disclaimer: term might be incorrect, think a .bat file for an example of linear logic). Both programs basically work in the same manner using a Boolean (variable flag in my case) paired with logic (if statements) to determine what the program should be doing. The original was if flag == 1 then play the opening of the Tetris theme, if flag == 0 then stop (controlled by if while loops). Now the program displays a looping True (1) or False (0) depending on which mode the flag is in. There is also a pause to prevent the machine from rapidly changing flag’s state from 1 to 0 to 1 to 0… constantly if held down (this was the one change I had in mind before even finding out the code was gone). Before doing anything in writing the second code I checked to make sure that you can in fact save your code and access it on repl.it without being logged into an account. The proof is I was able to link the second code.


7 views0 comments

Recent Posts

See All

Final assignment (trivia project)

How I came to this idea for a project was simple. Back when I was in high school I made a trivia style game. This game was written for Windows Command Line (.bat file). The original program was quite

Assignment 9 (drawing program)

I made a drawing program with multiple colors that can be selected (with black being used as the eraser color as the background is black). I used an array to keep track of all the colors and used a fo

Assignment 8 (bug fixes)

change log: 1. Revised collision for ball to bounce off paddles properly (instead of requiring perfect pixel alignment with a sweet spot, which was the original collision detection. I figured out it w

bottom of page