Skip to content

Instantly share code, notes, and snippets.

View TIny-Hacker's full-sized avatar
🤔
Trying to understand my own code

TIny_Hacker TIny-Hacker

🤔
Trying to understand my own code
View GitHub Profile
@TIny-Hacker
TIny-Hacker / text-wrap.c
Last active November 10, 2023 23:06
Simple text wrapping and breaking at the end of words for the TI-84 Plus CE
// Find where to break lines
unsigned int spaceSearch(const char *string, const unsigned int start) {
for (int k = start; k >= 0; k--) {
if (string[k] == ' ') {
return k + 1;
}
}
return start;
}
@TIny-Hacker
TIny-Hacker / timer-debounce.c
Last active May 6, 2024 00:35
Key debouncing with timer
#include <keypadc.h>
#include <time.h>
int main(void) {
// Ensure no key is pressed when the program is first opened
while(kb_AnyKey());
bool keyPressed = false;
// Keep track of an offset for timer stuff
clock_t clockOffset = clock();
@TIny-Hacker
TIny-Hacker / gradient.py
Last active April 2, 2023 11:28
Gradient
from kandinsky import *
for y in range (225):
fill_rect(0, y, 320, 200 - y, (0, 0, y))
@TIny-Hacker
TIny-Hacker / rectangles.py
Last active April 2, 2023 11:21
Rectangles
from kandinsky import *
from random import *
from time import *
while True:
fill_rect(randint(0, 275), randint(0, 200), randint(0, 50), randint(0, 50), (randint(0, 255), randint(0, 255), randint(0, 255)))
sleep(.2)