Skip to content

Instantly share code, notes, and snippets.

View avidrucker's full-sized avatar

Avi Drucker avidrucker

  • SUNY New Paltz
  • New York
View GitHub Profile
# Initial code referenced from https://github.com/robert/wavefunction-collapse
import random
import math
from typing import Literal
import colorama
# Types
Tile = str
Coordinates = tuple[int, int]
@avidrucker
avidrucker / guess3.a
Created March 24, 2024 00:10
Number guessing game with pseudo random seed written in LCC assembly
startup: bl main
halt
; function that ensures that user input
; is always between 1 and 100 inclusive
; the return value is saved into r0
getnuminrange: push lr
push fp
mov fp, sp
@avidrucker
avidrucker / lcc-tools-test1.a
Last active March 31, 2024 02:33
Used to test out the syntax highlighting of LCC-Tools for VS Code
startup: bl main
halt
main: push lr
push fp
mov fp, sp
;; TODO: comment out the following chunk of code in order to have the program run
push rr
push ' '
@avidrucker
avidrucker / lang_proc_diagram_eg.md
Created March 14, 2024 16:43
An example Mermaid diagram for Language Processing
flowchart TD
    Q5 --b--> Q5
    Q5 --b--> Q4
    Q4 --a--> Q4
    Q4 --e--> Q5
    Q0 --a--> Q4
    Q0 --a--> Q0
    Q0 --a--> Q3
 Q0 --e--> Q1
@avidrucker
avidrucker / textmate_solarized_dark_colors.txt
Created March 7, 2024 20:03
A list of textmate capture names (entities? keywords?) and their colors in VS Code's Solarized Dark theme
in solarized dark, the following textmate capture names have the following colors:
blue:
- entity.name.tag
- entity.name.function (DONE: used for mnemonics)
- support.function
- support.function.git-rebase
- variable.language
- variable.other
@avidrucker
avidrucker / lcc-assembly-nested-while.a
Created March 7, 2024 19:31
Attempt at creating a reusable sleep/wait/timeout/pause function in LCC assembly
; attempt to make a delay between the printing of tokens
; such as two strings. the delay below is attempted via
; running a nested loop a couple hundred times. it doesn't
; yet seem to create any noticeable delay, and if the loops
; are increased to their maximum amount of 255, then the
; LCC compiler will fail to compile the program, stating
; that there is possibly an infinite loop. the eventual
; goal of this exercise is to create delay/sleep function
startup: bl main
@avidrucker
avidrucker / new_paltz_grad_faq.md
Last active February 22, 2024 16:38
SUNY New Paltz Grad Student FAQ
@avidrucker
avidrucker / LCCInstructionSetSummary.md
Created February 14, 2024 16:25
LCC Instruction Set Summary, Appendix B, from C and C++ Under the Hood by Anthony J. Dos Reis

LCC Instruction Set Summary

Mnemonic Binary Format Flags Set Description
br-- 0000 cc pcoffset9 if cc, pc = pc + pcoffset9
add 0001 dr sr1 000 sr2 nzcv dr = sr1 + sr2
add 0001 dr sr1 1 imm5 nzcv dr = sr1 + imm5
ld 0010 dr pcoffset9 dr = mem[pc + pcoffset9]
st 0011 sr pcoffset9 mem[pc + pcoffset9] = sr
bl, call, or jsr 0100 1 pcoffset11 lr= pc; pc = pc + pcoffset11
graph LR;
    Resource
    Resource --> Course
    Resource --> CourseSection
    Resource --> CourseSyllabus
    Resource --> LearningComponent
    LearningComponent --> AssociatedMaterial
    AssociatedMaterial --> ReferencedMaterial
    AssociatedMaterial --> SupplementalMaterial
@avidrucker
avidrucker / digraph_of_binary_digit_strings.md
Created November 13, 2023 15:14
a directed graph that models the set of strings of 0’s and 1’s (zero or more of each)
graph LR;
    s--1-->a;
    a--0--> c
    s--0-->b;
    b--1-->a;
    a--1-->a;
    b--0-->b;
    c--0-->c;