(OnRamps Computer Science Project) In this project, see binary code in action where it determines what time of weather there is, the intensity of the weather, and more! If the weather is generated poorly, such as if the precipitation is to slow or if it is very minimal, just click the flag again. Documentation Program Introduction This is a random generation program developed mainly with binary code. A random type of weather is generated and positioned based off of a binary list. The same goes for the cars, costume and speed is selected from a list. The variables will tell you the time, weather, and car frequency. Algorithms Originally, I had attempted to make a planet generation system called “Grid Space”. Unfortunately, I spent a lot of time learning how to prevent the planet overlap, but I couldn’t figure it out and it failed. So I switched to the weather generation project. I used two repeat blocks to cut the binary string evenly into fifty 6-digit chunks. From there, I used a block to convert any binary input into decimal by utilizing a bit system. I used 1, 2, 4, 8, 16, and 32 to determine the binary number with the checking system. Then from that, I could use the decimal number inside variables to determine weather, speed, color, and more. I also used bounds for things that didn’t require all 64 potential numbers from each 6 digit chunk. For example, any number less than seventeen coded for rain, any below 32 and above 16 for hail, and so on. Binary String Parsing To parse the binary string, I used a 50 repeat block and a 6 repeat block on the inside to combine the letters individually from the string. This would create 50 chunks of 6 bits. I then added that piece to the list and reset the piece variable to empty. I did the same thing for the next list except moving the starting letter value and tagging the beginning to the end so it would create completely different outputs. Generating From Lists To generate from the lists, I used a block that converted the variable input, where I placed a list item, and it changed the binary value to decimal. Then it utilized this by inputting the value into a variable. Clones & Blocks I mainly used blocks in this project. All the binary was stored in a list, then converted to decimal using blocks and transferred to variable. I used blocks to input any value from a list and use the same system efficiently, but the blocks were mainly used in this program to break up the code into sections so it was cleaner and organized. I knew where to find bugs because of the labels. The clones were used to create a heavier rain effect. The cars were also varied clones.
Websites used: https://www.fesliyanstudios.com/royalty-free-music/downloads-c/8-bit-music/6 for music https://pixabay.com/sound-effects/search/ufo/ for UFO sound effect All pixel art by me (made in Aseprite)