User Tools

Site Tools


notes:fall2024:projects:dsr0

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:fall2024:projects:dsr0 [2024/09/21 01:01] – [state file: keeping score across sessions] cmazzaranotes:fall2024:projects:dsr0 [2024/09/26 16:08] (current) – [checking time] jmerri10
Line 3: Line 3:
 =====powers of two base math===== =====powers of two base math=====
 Base 2^1 is 2 2^2 is 4 2^3 is 8 and so on and so forth. Base 2^1 is 2 2^2 is 4 2^3 is 8 and so on and so forth.
 +
 +Along with the conversions game mode, other modes should include addition, subtraction, and multiplication. These should all be in the same base already, as a conversion on top of that would be hectic.
 =====powers of two base conversions===== =====powers of two base conversions=====
 +For powers of two base conversion, or any type of conversions in bash scripts, it would behoove one to make use of the ibase / obase commands. With them, they can make the conversions of numbers for you. This is helpful for generating prompts and keys alike.
  
 +The goal of the conversions game mode should be for the player to be prompted with a number in one base, and be instructed to find the answer in another base (also prompted).
 +
 +Can use shuf -i alongside an array to randomly generate a base
 =====checking time===== =====checking time=====
 By using "date  +%r" in the command line you can get the current time which you can use later. By using "date  +%r" in the command line you can get the current time which you can use later.
 +
 +date +%r will give you the time in this format: HH:MM:SS AM/PM
 +
 +date +%s will give you the time in seconds since the Unix epoch. If you want to use date +%s to get the current minutes, you can divide the output of date +%s by 60; if you want to use date +%s to get the current seconds, you can use the modulus operation (%60).
 +
 =====state file: keeping score across sessions===== =====state file: keeping score across sessions=====
  
notes/fall2024/projects/dsr0.1726880505.txt.gz · Last modified: 2024/09/21 01:01 by cmazzara