User Tools

Site Tools


notes:discrete:fall2021:projects:fom0

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
notes:discrete:fall2021:projects:fom0 [2021/10/26 19:14] – [Process] mpronti2notes:discrete:fall2021:projects:fom0 [2021/10/28 03:54] (current) – Added more details on how to understand 'contains' method smalik3
Line 31: Line 31:
  
 ===A Note on the Binary Number System=== ===A Note on the Binary Number System===
-The binary number system is much like the base 10 system we know and love, except there is one small difference; binary is base 2. Thus, the only individual digits available are 1's and 0's. For counting purposes, it is incremented by one on the right side, flipping the left bit once it surpasses 1. This is kind of hard to explain over words alone, so observe this example:+The binary number system is much like the base-10 system we know and love, except there is one small difference; binary is base-2. Thus, the only individual digits available are 1's and 0's. For counting purposes, it is incremented by one on the right side, flipping the left bit once it surpasses 1. This is kind of hard to explain over words alone, so observe this example:
 <code> <code>
 0000 - 0 0000 - 0
Line 50: Line 50:
 1111 - 15 1111 - 15
 </code> </code>
 +From here, you may have noticed a pattern; one can calculate the number of individual base-10 numbers from the length of the respective binary number. For example, the above binary integer had 4 digits. 4^2, in base-10, is 16, and there are 16 respective base-10 integers in the example. So, for a minimum of 9 digits in this project, one can fit an equivalent 2^9 base-10 integers, or 0 - 511.
 +
 ===Successive Containment=== ===Successive Containment===
  
Line 77: Line 79:
          
 Obviously, this should be scaled up for fom0 purposes, because we will be counting to higher numbers than 15. The logic however remains the same, we just start by subtracting higher numbers for higher places. Obviously, this should be scaled up for fom0 purposes, because we will be counting to higher numbers than 15. The logic however remains the same, we just start by subtracting higher numbers for higher places.
 +
 +One more thing to note, conditions like "Is 5 - 4 >= 0?" can be simplified to "Is 5 >= 4?". Both are accurate ways of looking at this method. The point of this method is to see whether a particular number contains another number. If you can subtract one number from another then that number must contain what is subtractable. If a number is greater than or equal to another number, then it must contain the number it is greater than or equal to.
  
 ===Modulo Conversion=== ===Modulo Conversion===
Line 162: Line 166:
  
 Blazam! Now we have an ‘on’ state for the final bit, and therefore a known state for every bit in the number 13. For larger numbers like the ones we will see on fom0, we will scale this method up.  Blazam! Now we have an ‘on’ state for the final bit, and therefore a known state for every bit in the number 13. For larger numbers like the ones we will see on fom0, we will scale this method up. 
 +
 +In lua, we will need to take a look at the current bits of the number being converted to binary. A really easy way to do this is with the following syntax "if (number & 1)==1  then". This if statement checks if the furthest bit on the right of the current number being assessed is 1. We can then shift the bits of the current number being assessed to the right and repeat the if statement. 
 ====Display==== ====Display====
  
 In terms of display, the basics are as such: two sprites should exist, one which represents an off state (this could also be a blank / no sprite), and one which represents an on state. By showing either of these two sprites as part of some ordered set, a binary number can be represented as if it were 1s and 0s. In terms of display, the basics are as such: two sprites should exist, one which represents an off state (this could also be a blank / no sprite), and one which represents an on state. By showing either of these two sprites as part of some ordered set, a binary number can be represented as if it were 1s and 0s.
 =====References===== =====References=====
 +
 +https://github.com/nesbox/TIC-80/wiki
  
 https://en.wikipedia.org/wiki/Binary_number https://en.wikipedia.org/wiki/Binary_number
Line 172: Line 180:
  
 https://www.youtube.com/watch?v=kVvP5MNIND4 https://www.youtube.com/watch?v=kVvP5MNIND4
 +
 +https://www.youtube.com/watch?v=rsxT4FfRBaM
 +
 +http://lua-users.org/wiki/BitwiseOperators
 =====Submission===== =====Submission=====
 +
 +To submit the game file, our "tic" file, the file must be added to your lab46 somehow. This can be achieved through FTP software, such as FileZilla, or more easily by putting the file onto your Pi then pushing to your repo and pulling from lab46.
 +
 +//Of course, if you are using the TIC-80 application on your Pi then the file will exist there when saved.//
 +
 +To submit this project using the **submit** tool, run the following command at your lab46 prompt:
 +
 +<cli>
 +lab46:~/src/SEMESTER/DESIG/fomX$ submit DESIG fomX GAMENAME.tic
 +Submitting DESIG project "fomX":
 +    -> GAMENAME.tic(OK)
 +
 +SUCCESSFULLY SUBMITTED
 +</cli>
 +
 +NOTE: "GAMENAME" here is the name of your game. Please do not literally submit a tic file named "GAMENAME", come up with a creative name for your game.
 +
 I'll be looking for the following: I'll be looking for the following:
  
notes/discrete/fall2021/projects/fom0.1635275668.txt.gz · Last modified: 2021/10/26 19:14 by mpronti2