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/28 03:19] – [References] mbrill1notes:discrete:fall2021:projects:fom0 [2021/10/28 03:54] (current) – Added more details on how to understand 'contains' method smalik3
Line 79: 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 164: 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====
  
Line 181: Line 185:
 http://lua-users.org/wiki/BitwiseOperators 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.1635391198.txt.gz · Last modified: 2021/10/28 03:19 by mbrill1