Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions exercises/demo.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
██████╗ ██╗████████╗ ██╗ ██╗ ██████╗
██╔════╝ ██║╚══██╔══╝███║███║██╔═████╗
██║ ███╗██║ ██║ ╚██║╚██║██║██╔██║
██║ ██║██║ ██║ ██║ ██║████╔╝██║
╚██████╔╝██║ ██║ ██║ ██║╚██████╔╝
╚═════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝
15 changes: 14 additions & 1 deletion exercises/workshop.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
"""Short and sweet demo program."""

__author__ = "<your name>" # Fill in your name here - always good practice to have an __author__ variable.
import random

__author__ = "Jesse Wei <jessew13@email.unc.edu>"

# Please don't modify this list :)
# ok i won't
SECRET: list[str] = [' ', '█', '█', '█', '█', '█', '█', '╗', ' ', '█', '█', '╗', '█', '█', '█', '█', '█', '█', '█', '█', '╗', ' ', '█', '█', '╗', ' ', '█', '█', '╗', ' ', '█', '█', '█', '█', '█', '█', '╗', ' ', '\n', ' ', '█', '█', '╔', '═', '═', '═', '═', '╝', ' ', '█', '█', '║', '╚', '═', '═', '█', '█', '╔', '═', '═', '╝', '█', '█', '█', '║', '█', '█', '█', '║', '█', '█', '╔', '═', '█', '█', '█', '█', '╗', '\n', ' ', '█', '█', '║', ' ', ' ', '█', '█', '█', '╗', '█', '█', '║', ' ', ' ', ' ', '█', '█', '║', ' ', ' ', ' ', '╚', '█', '█', '║', '╚', '█', '█', '║', '█', '█', '║', '█', '█', '╔', '█', '█', '║', '\n', ' ', '█', '█', '║', ' ', ' ', ' ', '█', '█', '║', '█', '█', '║', ' ', ' ', ' ', '█', '█', '║', ' ', ' ', ' ', ' ', '█', '█', '║', ' ', '█', '█', '║', '█', '█', '█', '█', '╔', '╝', '█', '█', '║', '\n', ' ', '╚', '█', '█', '█', '█', '█', '█', '╔', '╝', '█', '█', '║', ' ', ' ', ' ', '█', '█', '║', ' ', ' ', ' ', ' ', '█', '█', '║', ' ', '█', '█', '║', '╚', '█', '█', '█', '█', '█', '█', '╔', '╝', '\n', ' ', '╚', '═', '═', '═', '═', '═', '╝', ' ', '╚', '═', '╝', ' ', ' ', ' ', '╚', '═', '╝', ' ', ' ', ' ', ' ', '╚', '═', '╝', ' ', '╚', '═', '╝', ' ', '╚', '═', '═', '═', '═', '═', '╝', ' ', '\n']

def main() -> None:
Expand All @@ -18,6 +21,16 @@ def main() -> None:
# A simple print statement, something interesting, or anything else.
# If you want your pull request to be accepted, don't put anything you wouldn't want others to see.

# what if i just add a comment

# ok fine I'll add a print statement in a loop
num_times: int = int(input("Type a number, any number! "))
for i in range(num_times):
print("Hello world " + str(i))


# if __name__ == "__main__" is lame
# actually functions are lame I prefer to keep all my code at the global level

if __name__ == "__main__":
main()
41 changes: 41 additions & 0 deletions experimental-features/experimental-file.asm
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# This assembly code is equivalent to the C code in the same directory.

.data

prompt: .asciiz "Type a number, any number! "
hello_world: .asciiz "Hello, world "
newline: .asciiz "\n"

.text

main:
addi $v0, $0, 4 # system call (4) to print string
la $a0, prompt # load string memory address into $a0
syscall # print string

addi $v0, $0, 5 # system call (5) to get integer from user and store in $v0
syscall # get user input for num_times
add $s0, $0, $v0 # store num_times in $s0

addi $t0, $0, 0 # for (int i = 0; ...)

loop:
addi $v0, $0, 4 # system call (4) to print string
la $a0, hello_world # load string memory address into $a0
syscall # print string

addi $v0, $0, 1 # system call (1) to print int (base-0)
add $a0, $0, $t0 # $a0 = i
syscall # print int

addi $v0, $0, 4 # system call (4) to print string
la $a0, newline # load string memory address into $a0
syscall # print string

addi $t0, $t0, 1 # for (...; ...; i++)
slt $t1, $t0, $s0 # $t1 = $t0 < $s0
bne $t1, $0, loop # if $t1 != 0, goto loop

exit:
ori $v0, $0, 10 # system call (10) to exit
syscall # exit1
16 changes: 16 additions & 0 deletions experimental-features/secret-stuff.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Compile with gcc secret-stuff.c
// Run with ./a.out

#include <stdio.h>

int num_times;

int main() {
printf("Type a number, any number! ");
scanf("%d", &num_times); // %d means placeholder for int, & is the "address
// of" operator
for (int i = 0; i < num_times; i++) {
printf("Hello, world %d\n", i);
}
return 0;
}
7 changes: 7 additions & 0 deletions lessons/.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
hidden test file to test if pulling from upstream/main works

hello hello hello

testing testing test

1 2 3
Loading