Skip to content

Instantly share code, notes, and snippets.

View Duality4Y's full-sized avatar

Robert Duality4Y

  • none
  • Netherlands
  • 13:31 (UTC -12:00)
View GitHub Profile
@Duality4Y
Duality4Y / main.c
Last active October 8, 2019 09:35
???
/* ??? */
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
// two arguments required one string input and one the number of '?' to be added
if(argc != 3)
{
@Duality4Y
Duality4Y / Scanner.java
Created February 21, 2018 15:27
craftinginterpreters scanner gist
package lox;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static lox.TokenType.*;
public class Scanner
@Duality4Y
Duality4Y / interpreter1.py
Last active April 22, 2018 09:37
interpreter miniseries
import operator
INTEGER, PLUS, MINUS, EOF, WHITESPACE = 'INTEGER', 'PLUS', 'MINUS', 'EOF', 'WHITESPACE'
class Token(object):
def __init__(self, type, value):
self.type = type
self.value = value
def __str__(self):
return 'Token({type}, {value})'.format(type=self.type, value=repr(self.value))
@Duality4Y
Duality4Y / main.py
Last active January 6, 2018 22:26
Pygame Strange Attractor.
"""
main.py
Author: Robert (Duality)
Git: https://github.com/Duality4y
notes:
this is an implementation of the strange attractor in python.
using pygame to draw it.
details can be found here:
https://en.wikipedia.org/wiki/Lorenz_system
@Duality4Y
Duality4Y / c cast to different sizes.md
Last active May 18, 2016 15:36
this test casts a array of values to different pointer size's and see how that affects operations on the casted data.
#include <stdio.h>
#include <stdint.h>

uint8_t values[100];

int main(int argc, char **argv)
{
    for(int i = 0; i < 100; i++)
    {