Skip to content

WompaStompa/SwitchSlide

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SwitchSlide

Like a slide rule, but for Switch.

Just a very basic edit of switchbrew's simplegfx example and touch-screen example.

The scales from top to bottom are:

  1. Double Logarithmic (1 to 10 to 100)
  2. Folded Single Logarithmic with index at Pi (π to 10, 10 = 1, 1 to π)
  • Blue line denoting boundary between slide and top stator
  1. Folded Single Logarithmic with index at Pi (π to 10, 10 = 1, 1 to π)
  2. Red Inverse Single Logarithmic (10 to 1)
  3. Single Logarithmic (1 to 10)
  • Blue line denoting boundary between slide and bottom stator
  1. Single Logarithmic (1 to 10)
  2. Linear (0 to 1)

Now with binary!

The scales from left to right are:

  1. Single Logarithmic (1 to 2)
  • Blue line denoting boundary between slide and left stator
  1. Single Logarithmic (1 to 2)
  2. Red Inverse Logarithmic (2 to 1)
  • Blue line denoting boundary between slide and right stator
  1. Red Inverse Logarithmic (2 to 1)
  2. Double Logarithmic (1 to 2 to 4)

Take advantage of the power of iteration to get increasingly accurate results. For example, say you wanted to know 590÷101.

  1. Estimate what the answer should be. 590 is about 600 and 101 is about 100, so 590÷101 should be about 6.
  2. Use the slide rule to get an answer of about 5.84.
  3. 5.84×101 = 589.84. This means our error is (590-589.84)÷101 = 0.16÷101.
  4. Use the slide rule to evaluate 0.16÷101 to be about 0.001584.
  5. Add the error correction to our first calculation to get 590÷101 = 5.841584.
  6. 5.841584×101 = 589.999984. If this still isn't accurate enough for what you're doing, iterate again. In this case though, you could just notice that the next iteration would be a power of 10 times a previous iteration, meaning you've already found the repeating decimal expansion.

Keybinds:

Button Function
Plus (+) Go back to HBMenu
Touch Screen Move the slide/hairline.
A Switch between moving the slide and hairline.
B Reset the slide position.
X Reset the hairline position.
Y Switch between the different scales.*

*So far I only have decimal and binary scales. My current process is a tedious pain in the dick, but I might make more scales later.

Issues:

  • Slowly sliding your finger horizontally across the screen is kinda jittery and makes lining up your calculation a bit of a pain. To counter this, slide at a normal speed and a steep vertical angle. The vertical component of the slide will effectively just get ignored but the small horizontal component will always be accounted for.
  • The scales won't line up perfectly when slid relative to one another because I only lined up the gradations with the nearest pixel. So for example, the 3.4 line on the decimal scale would go at x position 1280×log₁₀(3.4) = 680.293, so I just put it at x coordinate 680. They should all be close enough to the true value that the power of estimation will give you accurate enough results.

Fuck OpenGL and gpu compute, software render is all I need.