Skip to content

Instantly share code, notes, and snippets.

View quackduck's full-sized avatar
running...

Ishan Goel quackduck

running...
View GitHub Profile
//Pins
int redled = 11;
int greenled = 10;
int blueled = 9;
int an2 = 2;
//Colours
int red = 255;
int green = 255;
int blue = 255;
@quackduck
quackduck / kolakoski.go
Created March 10, 2021 15:40
Implement a kolakoski sequence generator: OEIS:A000002
package main
import (
"fmt"
"strconv"
"strings"
)
var (
// n is the number of terms to calculate
package main
import (
"bufio"
"io"
"io/ioutil"
"math/rand"
"os"
"strings"
"time"
public class Projectile {
public double angleOfLaunch; // in radians
public double initialX; // in meters
public double initialVelocity; // in m/s
public boolean useTimeToMaxHeight = false;
private double gravity; // m/s^2
@quackduck
quackduck / AssertVerifier.java
Created February 9, 2022 02:42
Solve AP CS A assertion problems automatically
package assertion;
import java.util.ArrayList;
public class AssertVerifier {
static int numConditions = 3;
static int numPoints = 5;
// numbers to test
static int start = -100000;
@quackduck
quackduck / duckcoin.exe.base64
Created May 18, 2022 15:23
duckcoin-windows
This file has been truncated, but you can view the full file.
TVqQAAMABAAAAAAA//8AAIsAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAA4fug4AtAnNIbgBTM0hVGhpcyBwcm9ncmFtIGNhbm5vdCBiZSBydW4gaW4gRE9TIG1vZGUuDQ0KJAAAAAAAAABQRQAAZIYNAAAAAAAAMGoAuxsAAPAAIgILAgMAAMolAADAAwAAAAAAgDwGAAAQAAAAAEAAAAAAAAAQAAAAAgAABgABAAEAAAAGAAEAAAAAAAAAdgAABgAAAAAAAAMAYIEAACAAAAAAAAAQAAAAAAAAAAAQAAAAAAAAEAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAHAAfAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQcAD6kQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4DNJAEABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAudGV4dAAAAOrIJQAAEAAAAMolAAAGAAAAAAAAAAAAAAAAAAAgAABgLnJkYXRhAAAoRSMAAOAlAABGIwAA0CUAAAAAAAAAAAAAAAAAQAAAQC5kYXRhAAAAYMoJAAAwSQAAwAMAABZJAAAAAAAAAAAAAAAAAEAAAMAvNAAAAAAAACcBAAAAAFMAAAIAAADWTAAAAAAAAAAAAAAAAABAABBCLzE5AAAAAADMHwYAABBTAAAgBgAA2EwAAAAAAAAAAAAAAAAAQAAQQi8zMgAAAAAA+jUBAAAwWQAANgEAAPhSAAAAAAAAAAAAAAAAAEAAEEIvNDYAAAAAADkAAAAAcFoAAAIAAAAuVAAAAAAAAAAAAAAAAABAABBCLzY1AAAAAAC3uwsAAIBaAAC8CwAAMFQAAAAAAAAAAAAAAAAAQAAQQi83OAAAAAAA7KYHAABAZgAAqAcAAOxfAAAAAAAAAAAAAAAAAEAAEEIvOTAAAAAAAIYDAgAA8G0A
@quackduck
quackduck / main.py
Created June 10, 2022 03:48
random color sierpinski triangle
import turtle
import random
def randColor():
t.color(random.random(), random.random(), random.random())
def draw_sierpinski(length, depth):
if depth==0:
for i in range(0,3):
@quackduck
quackduck / main.go
Created August 7, 2022 01:57
Stupid hash function made on a plane without WiFi
// go build
// ./main "random string"
// 2f4563a971944e00
package main
import (
"fmt"
"os"
)
package main
import (
"errors"
"fmt"
"image"
"image/color"
"image/png"
"math"
"os"
@quackduck
quackduck / prime.c
Created November 20, 2023 06:59
prime.c
#include <stdio.h>
#include <math.h>
#define TARGET 1000000
int main() {
long long found = 0;
long long num = 2;
while (found < TARGET) {
long long till = sqrtl(num);