parent
1c1c87a375
commit
a25a30f90c
5 changed files with 128 additions and 28 deletions
10
content/lab-notes/Chess.md
Executable file
10
content/lab-notes/Chess.md
Executable file
|
@ -0,0 +1,10 @@
|
||||||
|
# Game Loop
|
||||||
|
- display board
|
||||||
|
- check if endgame state
|
||||||
|
- end game if needed
|
||||||
|
- get current side
|
||||||
|
- get move for current side
|
||||||
|
|
||||||
|
---
|
||||||
|
- `Game` struct contains game state
|
||||||
|
- Refactor to trait?
|
|
@ -1,3 +1,71 @@
|
||||||
---
|
---
|
||||||
{}
|
{}
|
||||||
---
|
---
|
||||||
|
# Hardware
|
||||||
|
- Display Resolution: 192x160
|
||||||
|
- potentially just upscaled from 96x80
|
||||||
|
- at 3x scaling that's 576x480, 32px pillarboxes if 640x480
|
||||||
|
- 384x320
|
||||||
|
- how small can the screen physically be?
|
||||||
|
- android guidelines say 48dp @ 160dpi or 0.3"
|
||||||
|
- android guidelines also say 48dp is about 9mm so who the fuck knows anymore
|
||||||
|
- apple says 44pt ~~or 44/72" or 0.61"~~
|
||||||
|
- 44pt is 44px, 88px, 132px depending on device
|
||||||
|
- 132px on iPhone X @ 448(?)dpi so ~ 0.294"
|
||||||
|
- 192x160 is 1.2"x1"
|
||||||
|
- 640x480 is 4"x5" for a 6.4" diagonal
|
||||||
|
- 28.8" x 24" needed to meet android accessibility guidelines jfc
|
||||||
|
- tl;dr: Apple and Google seem to want about 0.3"per target
|
||||||
|
- NDS screen size is 106.666 dpi
|
||||||
|
- poketch would be 1.8x1.5"
|
||||||
|
- **640x480 would be 2x1.5" or 2.5" diagonal**
|
||||||
|
- https://www.adafruit.com/product/2478 should do the trick
|
||||||
|
- 320x240 2.4"
|
||||||
|
- we use 288x240 (1.5x)
|
||||||
|
|
||||||
|
- 2 Bit grayscale
|
||||||
|
- Touch screen
|
||||||
|
- 5:4 aspect ratio
|
||||||
|
- 1/2 physical buttons
|
||||||
|
# etc
|
||||||
|
- will need a font
|
||||||
|
- sprite based?
|
||||||
|
- ttf based?
|
||||||
|
- https://lvgl.io/tools/fontconverter
|
||||||
|
# stretch goals
|
||||||
|
- use wifi/ble
|
||||||
|
- config applet
|
||||||
|
- also would handle right vs left handed
|
||||||
|
- mqtt/ntfy.sh
|
||||||
|
- display notifications using margins?
|
||||||
|
- android notifications sync
|
||||||
|
- requires adding to gadgetbridge long term
|
||||||
|
- pedometer
|
||||||
|
- needs extra hardware
|
||||||
|
|
||||||
|
# Sprites
|
||||||
|
- [x] Digital Watch
|
||||||
|
- [x] Calculator
|
||||||
|
- [ ] Memo Pad
|
||||||
|
- [x] Pedometer
|
||||||
|
- [x] Pokemon List
|
||||||
|
- [x] Friendship Checker
|
||||||
|
- [ ] Dowsing Machine
|
||||||
|
- [x] Berry Searcher
|
||||||
|
- [ ] Day-Care Checker
|
||||||
|
- [ ] Pokemon History
|
||||||
|
- [ ] Counter
|
||||||
|
- [x] Analog Watch
|
||||||
|
- [x] Marking Map
|
||||||
|
- [x] Link Searcher
|
||||||
|
- [ ] Coin Toss
|
||||||
|
- [ ] Move Tester
|
||||||
|
- [ ] Calendar
|
||||||
|
- [ ] Dot Artist
|
||||||
|
- [x] Roulette
|
||||||
|
- [ ] Chain Counter
|
||||||
|
- [x] Kitchen Timer
|
||||||
|
- [ ] Color Changer
|
||||||
|
- [ ] Matchup Checker
|
||||||
|
- [ ] Stopwatch
|
||||||
|
- [ ] Alarm Clock
|
||||||
|
|
23
content/lab-notes/Toki Pona Hex Encoding.md
Executable file
23
content/lab-notes/Toki Pona Hex Encoding.md
Executable file
|
@ -0,0 +1,23 @@
|
||||||
|
|
||||||
|
| | |
|
||||||
|
| --- | --- |
|
||||||
|
| a | A |
|
||||||
|
| e | E/* |
|
||||||
|
| i | 1 |
|
||||||
|
| o | 0 |
|
||||||
|
| u | 5 |
|
||||||
|
| n | 7 |
|
||||||
|
| | |
|
||||||
|
| j | 3 |
|
||||||
|
| k | 9 |
|
||||||
|
| l | 6 |
|
||||||
|
| m | 4 |
|
||||||
|
| p | B |
|
||||||
|
| s | C |
|
||||||
|
| t | D |
|
||||||
|
| w | 2 |
|
||||||
|
| ∅ | F/# |
|
||||||
|
|
||||||
|
D091 41 3A7 416A
|
||||||
|
|
||||||
|
Ports over to DTMF as well
|
|
@ -1,3 +1,2 @@
|
||||||
---
|
https://file-extensions.com/docs/pkpasss
|
||||||
{}
|
https://developer.apple.com/documentation/walletpasses
|
||||||
---
|
|
|
@ -11,10 +11,10 @@ You know what, fuck you _rotates your interest rates 90°_
|
||||||
Y'all remember this from like 4th grade right, I barely do so here's a refresh
|
Y'all remember this from like 4th grade right, I barely do so here's a refresh
|
||||||
$$ z = Pe^{rt} $$
|
$$ z = Pe^{rt} $$
|
||||||
|
|
||||||
- \(P\) is your principal, or how much money you initially put in or took out
|
- $P$ is your principal, or how much money you initially put in or took out
|
||||||
- \(r\) is the interest rate, you want this to be low if you're borrowing and high if you're lending
|
- $r$ is the interest rate, you want this to be low if you're borrowing and high if you're lending
|
||||||
- \(t\) is time, unless you have a TARDIS, this one is pretty out of your control
|
- $t$ is time, unless you have a TARDIS, this one is pretty out of your control
|
||||||
- \(z\) is how much money you owe/are owed, I know this isn't the standard variable name but bear with me
|
- $z$ is how much money you owe/are owed, I know this isn't the standard variable name but bear with me
|
||||||
|
|
||||||
Now let's make it spicy
|
Now let's make it spicy
|
||||||
|
|
||||||
|
@ -26,13 +26,13 @@ Let's keep things simple for now and just rotate it around 0 like it's a circle
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
We can represent this as a complex number in the form \(z=Pe^{i\theta}\), where \(\theta\) is some angle.
|
We can represent this as a complex number in the form $z=Pe^{i\theta}$, where $\theta$ is some angle.
|
||||||
Hold on a second this looks kinda like the the interest rate formula from earlier. Let's add in time as a factor to get: \(z=Pe^{i\theta t}\).
|
Hold on a second this looks kinda like the the interest rate formula from earlier. Let's add in time as a factor to get: $z=Pe^{i\theta t}$.
|
||||||
|
|
||||||
Okay so we can see that this is basically just compound interest with an interest rate of \(\theta\).
|
Okay so we can see that this is basically just compound interest with an interest rate of $\theta$.
|
||||||
What does this even mean, can I use this to get out of student loans? Do I owe MOHELA imaginary money?
|
What does this even mean, can I use this to get out of student loans? Do I owe MOHELA imaginary money?
|
||||||
|
|
||||||
Well I left out an important detail, \(Pe^{i\theta}=P\cos(t\theta)+iP\sin(t\theta)\)
|
Well I left out an important detail, $Pe^{i\theta}=P\cos(t\theta)+iP\sin(t\theta)$
|
||||||
|
|
||||||
The proof is trivial and would be left as an exercise to the reader but unfortunately I need to use it later on so here's why this works:
|
The proof is trivial and would be left as an exercise to the reader but unfortunately I need to use it later on so here's why this works:
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@ So let's say I owe 1,000 USD at a 5% interest rate (I wish lmao), that would loo
|
||||||
|
|
||||||
> [!TODO] Todo
|
> [!TODO] Todo
|
||||||
|
|
||||||
That makes sense, but now let's look at what happens if we do \(5i\%\)
|
That makes sense, but now let's look at what happens if we do $5i\%$
|
||||||

|

|
||||||
Well the real part ends up being
|
Well the real part ends up being
|
||||||
$$\Re(z)=P\cos(\frac\pi 2rt)$$
|
$$\Re(z)=P\cos(\frac\pi 2rt)$$
|
||||||
|
@ -66,32 +66,32 @@ Normally when you rotate something you move it in a circle, which is cool and al
|
||||||

|

|
||||||
Introducing: the Hyperbola
|
Introducing: the Hyperbola
|
||||||

|

|
||||||
So with the unit circle we had an equation like \(x^2+y^2=1\), well there's a unit Hyperbola too and the equation for that is \(x^2-y^2=1\).
|
So with the unit circle we had an equation like $x^2+y^2=1$, well there's a unit Hyperbola too and the equation for that is $x^2-y^2=1$.
|
||||||
There's actually a lot more stuff that circles have that have a hyperbolic equivalent.
|
There's actually a lot more stuff that circles have that have a hyperbolic equivalent.
|
||||||
|
|
||||||
Remember \(\sin\) and \(\cos\)? There's also a \(\sinh\) and \(\cosh\), don't ask me to explain these because we didn't cover them at all in high school.
|
Remember $\sin$ and $\cos$? There's also a $\sinh$ and $\cosh$, don't ask me to explain these because we didn't cover them at all in high school.
|
||||||
|
|
||||||
Here's the big one that we care about though, we know multiplying something by \(i\) rotates it around a circle, there's actually a \(j\) that rotates something around a hyperbola.
|
Here's the big one that we care about though, we know multiplying something by $i$ rotates it around a circle, there's actually a $j$ that rotates something around a hyperbola.
|
||||||
|
|
||||||
But what exactly is this mysterious \(j\)?. It's shrimple as really, \(j=\sqrt{1}\).
|
But what exactly is this mysterious $j$?. It's shrimple as really, $j=\sqrt{1}$.
|
||||||
|
|
||||||
> [!QUOTE] Isn't that just 1?
|
> [!QUOTE] Isn't that just 1?
|
||||||
|
|
||||||
No. don't think about it too hard
|
No. don't think about it too hard
|
||||||
|
|
||||||
> [!QUOTE] So what does \(e^{\theta j}\) break down into, if anything?
|
> [!QUOTE] So what does $e^{\theta j}$ break down into, if anything?
|
||||||
|
|
||||||
I wouldn't be asking this rhetorical if there wasn't a semi-interesting answer
|
I wouldn't be asking this rhetorical if there wasn't a semi-interesting answer
|
||||||
It's actually \(Pe^{j\theta t} = P\cosh(t\theta)+jP\sinh(t\theta)\)
|
It's actually $Pe^{j\theta t} = P\cosh(t\theta)+jP\sinh(t\theta)$
|
||||||
|
|
||||||
# Dual Interest rates
|
# Dual Interest rates
|
||||||
|
|
||||||
Okay this one isn't as interesting but I want to include it for completeness,
|
Okay this one isn't as interesting but I want to include it for completeness,
|
||||||
We have \(i=\sqrt{-1},\ j=\sqrt{1}\), now get ready for \(\varepsilon=\sqrt{0}\). I guess was taken when they invented this one?
|
We have $i=\sqrt{-1},\ j=\sqrt{1}$, now get ready for $\varepsilon=\sqrt{0}$. I guess was taken when they invented this one?
|
||||||
|
|
||||||
> [!Todo] todo
|
> [!Todo] todo
|
||||||
|
|
||||||
while we're on the topic of dual numbers, lets try shoving \(x+\varepsilon\) into some functions for shits and giggles:
|
while we're on the topic of dual numbers, lets try shoving $x+\varepsilon$ into some functions for shits and giggles:
|
||||||
$$(x+\varepsilon)^2=x^2+2x\varepsilon+\varepsilon^2=2x\varepsilon$$
|
$$(x+\varepsilon)^2=x^2+2x\varepsilon+\varepsilon^2=2x\varepsilon$$
|
||||||
|
|
||||||
> [!quote] Okay that was a waste of time, was that supposed to be interesting?
|
> [!quote] Okay that was a waste of time, was that supposed to be interesting?
|
||||||
|
@ -100,9 +100,9 @@ Yes. I'm getting there
|
||||||
$$\sin(x+\varepsilon)=(x+\varepsilon)-\frac{(x+\varepsilon)^3}{3!}+\frac{(x+\varepsilon)^5}{5!}\ldots$$
|
$$\sin(x+\varepsilon)=(x+\varepsilon)-\frac{(x+\varepsilon)^3}{3!}+\frac{(x+\varepsilon)^5}{5!}\ldots$$
|
||||||
Okay now lets expand that out
|
Okay now lets expand that out
|
||||||
$$=(x+\varepsilon)-\frac{x^3+3x^2\varepsilon+3x\varepsilon^2+\varepsilon^3}{3!}+\frac{x^5+5x^4\varepsilon+10x^3\epsilon^2+10x^2\varepsilon^3+5x\varepsilon^4+\varepsilon^5}{5!}\ldots$$
|
$$=(x+\varepsilon)-\frac{x^3+3x^2\varepsilon+3x\varepsilon^2+\varepsilon^3}{3!}+\frac{x^5+5x^4\varepsilon+10x^3\epsilon^2+10x^2\varepsilon^3+5x\varepsilon^4+\varepsilon^5}{5!}\ldots$$
|
||||||
of course \(\varepsilon\) to powers higher than 1 just ends up being zero so we can simplify this monstrosity down to
|
of course $\varepsilon$ to powers higher than 1 just ends up being zero so we can simplify this monstrosity down to
|
||||||
$$=x+\varepsilon-\frac{x^3+3x^2\varepsilon}{3!}+\frac{x^5+5x^4\varepsilon}{5!}$$
|
$$=x+\varepsilon-\frac{x^3+3x^2\varepsilon}{3!}+\frac{x^5+5x^4\varepsilon}{5!}$$
|
||||||
...except this still doesn't mean too much, lets try factoring \(\varepsilon\) out
|
...except this still doesn't mean too much, lets try factoring $\varepsilon$ out
|
||||||
$$(x-\frac{x^3}{3!}+\frac{x^5}{5!}+\ldots)+\varepsilon(1-\frac{x^2}{2!}+\frac{x^4}{4!})$$
|
$$(x-\frac{x^3}{3!}+\frac{x^5}{5!}+\ldots)+\varepsilon(1-\frac{x^2}{2!}+\frac{x^4}{4!})$$
|
||||||
$$=\sin(x)+-\cos(x)\varepsilon$$
|
$$=\sin(x)+-\cos(x)\varepsilon$$
|
||||||
|
|
||||||
|
@ -110,10 +110,10 @@ $$=\sin(x)+-\cos(x)\varepsilon$$
|
||||||
|
|
||||||
Yeah actually. If you remember back to 8th grade,
|
Yeah actually. If you remember back to 8th grade,
|
||||||
$$f'(x)=\frac{d}{dx}f(x)=\lim_{h\to0}\frac{f(x+h)-f(x)}{h}$$
|
$$f'(x)=\frac{d}{dx}f(x)=\lim_{h\to0}\frac{f(x+h)-f(x)}{h}$$
|
||||||
We can kinda replace \(h\to 0\) here with \(\varepsilon\) since it's basically an infinitely tiny number that's not zero or negative, which gives us
|
We can kinda replace $h\to 0$ here with $\varepsilon$ since it's basically an infinitely tiny number that's not zero or negative, which gives us
|
||||||
$$f'(x)=\frac{f(x+\varepsilon)-f(x)}{\varepsilon}$$
|
$$f'(x)=\frac{f(x+\varepsilon)-f(x)}{\varepsilon}$$
|
||||||
|
|
||||||
> [!note] Dividing by is sus as fuck, but just bear with me here
|
> [!note] Dividing by $\varepsilon$ is sus as fuck, but just bear with me here
|
||||||
|
|
||||||
$$\varepsilon f'(x)=f(x+\varepsilon)-f(x)$$
|
$$\varepsilon f'(x)=f(x+\varepsilon)-f(x)$$
|
||||||
$$f(x+\varepsilon)=f(x)=\varepsilon f'(x)$$
|
$$f(x+\varepsilon)=f(x)=\varepsilon f'(x)$$
|
||||||
|
@ -123,12 +123,12 @@ There you go, typesetting this was a bitch.
|
||||||
|
|
||||||
## Matrix Representations
|
## Matrix Representations
|
||||||
|
|
||||||
Fun fact, you can also represent \(i,j,\varepsilon\) as matrices too
|
Fun fact, you can also represent $i,j,\varepsilon$ as matrices too
|
||||||
Its already kinda standard to use \(\begin{bmatrix}1&0\\0&1\end{bmatrix}\) to cast real numbers into 2D matrices, but there's two zeros in there doing nothing, maybe we can yoink those for real estate.
|
Its already kinda standard to use $\begin{bmatrix}1&0\\0&1\end{bmatrix}$ to cast real numbers into 2D matrices, but there's two zeros in there doing nothing, maybe we can yoink those for real estate.
|
||||||
|
|
||||||
Introducing:
|
Introducing:
|
||||||
$$i=\begin{bmatrix}0&1\\-1&0\end{bmatrix},\ j=\begin{bmatrix}0&1\\1&0\end{bmatrix},\ \varepsilon=\begin{bmatrix}0&1\\0&0\end{bmatrix}$$
|
$$i=\begin{bmatrix}0&1\\-1&0\end{bmatrix},\ j=\begin{bmatrix}0&1\\1&0\end{bmatrix},\ \varepsilon=\begin{bmatrix}0&1\\0&0\end{bmatrix}$$
|
||||||
These versions actually obey the same multiplication rules as our original derivations of the hypercomplex numbers. Now we can turn something like \(6+3j\) into \(\begin{bmatrix}6&3\\3&6\end{bmatrix}\)
|
These versions actually obey the same multiplication rules as our original derivations of the hypercomplex numbers. Now we can turn something like $6+3j$ into $\begin{bmatrix}6&3\\3&6\end{bmatrix}$
|
||||||
|
|
||||||
## Colors
|
## Colors
|
||||||
|
|
||||||
|
@ -136,7 +136,7 @@ As somewhat of a convention, I use red, green, and blue in this post to differen
|
||||||
|
|
||||||
## Honey, I broke the concept of division!
|
## Honey, I broke the concept of division!
|
||||||
|
|
||||||
Yeah... division doesn't really work right when you bring \(j\) and \(\varepsilon\) into the mix since you can multiply non-zero stuff and get zero out
|
Yeah... division doesn't really work right when you bring $j$ and $\varepsilon$ into the mix since you can multiply non-zero stuff and get zero out
|
||||||
|
|
||||||
$$\frac{1}{1+j}\cdot\frac{1}{1-j}=\frac{1}{1-j^2}=\frac{1}{1-1}=\frac10$$
|
$$\frac{1}{1+j}\cdot\frac{1}{1-j}=\frac{1}{1-j^2}=\frac{1}{1-1}=\frac10$$
|
||||||
$$\frac 1\varepsilon \cdot \frac 1\varepsilon=\frac 1{\varepsilon^2}=\frac 10$$
|
$$\frac 1\varepsilon \cdot \frac 1\varepsilon=\frac 1{\varepsilon^2}=\frac 10$$
|
||||||
|
|
Loading…
Add table
Reference in a new issue