Skip to content

Instantly share code, notes, and snippets.

View FAReTek1's full-sized avatar
:shipit:
Guthib is cool

faretek FAReTek1

:shipit:
Guthib is cool
View GitHub Profile
@FAReTek1
FAReTek1 / bases.py
Created January 17, 2025 18:08
basic script to convert base (ints only)
def convert_base(val, og_digits="0123456789", new_digits="0123456789"):
og_digits, new_digits = list(og_digits), list(new_digits)
og_base, new_base = len(og_digits), len(new_digits)
b10 = 0
val = str(val)
for i, digit in enumerate(val):
b10 += og_digits.index(digit) * og_base ** (len(val) - i - 1)
ret = ''
@FAReTek1
FAReTek1 / bases.py
Created January 17, 2025 18:28
Base conversion, for dp as well
def convert_base(val, og_digits="0123456789", new_digits="0123456789"):
og_digits, new_digits = list(og_digits), list(new_digits)
og_base, new_base = len(og_digits), len(new_digits)
b10 = 0
val = str(val)
for i, digit in enumerate(val):
b10 += og_digits.index(digit) * og_base ** (len(val) - i - 1)
ret = ''
@FAReTek1
FAReTek1 / bezier.gs
Created January 25, 2025 20:43
bezier.gs test
# Module dealing with all your bezier stuffies
# https://pomax.github.io/bezierinfo/
%include std\\geo2d.gs
%include std\\string.gs
# --- Structs ---
# --- Quad Bezier ---
func bezier2(Pt2D p0, Pt2D p1, Pt2D p2, t) Pt2D {
@FAReTek1
FAReTek1 / autogen.py
Last active February 3, 2025 19:59
goboscript package utility script
"""
This is a utility script for use when making goboscript packages that copy+pastes the package into the test/backpack folder
It also updates goboscript.toml with the dependecies from test/goboscript.toml.
"""
import os
import argparse
import shutil
import tomllib
@FAReTek1
FAReTek1 / goboscript @ syntax new commands
Last active February 23, 2025 15:43
Hopefully comprehensive list of all commands that should work with the hypothetical '@' syntax in goboscript
@.direction += 15;
@.direction -= 15;
# *=, /=, //=, %= would need to use point in direction block
# that would be a lot of implementations, considering all the different attributes, so there is abstraction needed here
@.direction = 90;
goto @gobo;
glide 1, @gobo;
point_towards @gobo;