Skip to content

Instantly share code, notes, and snippets.

View andeh575's full-sized avatar

Andrew Graham andeh575

View GitHub Profile
@andeh575
andeh575 / zipIt.hs
Created May 3, 2019 20:23
An exercise zipping together lists in Haskell
zipIt :: [a] -> [b] -> [(a,b)]
zipIt (a:as) (b:bs) = (a,b) : zipIt as bs
zipIt _ _ = []
main :: IO()
main = do
let x = zipIt [1,2,2,3] [4,5,6]
print x

Keybase proof

I hereby claim:

  • I am andeh575 on github.
  • I am andeh575 (https://keybase.io/andeh575) on keybase.
  • I have a public key ASBIPWlTs7awhv6H7X0Vn52NAcq-t80USkAQJRKLSRS-8Qo

To claim this, I am signing this object:

@andeh575
andeh575 / print_digits.c
Created January 24, 2018 15:17
Printing digits
/**
* Prints ascii digits
*
* Refresher on C; Learn C the hard way 1.3
*/
#include <unistd.h>
void my_putchar(char c)
{
@andeh575
andeh575 / rev_alpha.c
Created January 24, 2018 15:12
Simple reverse alphabet
/**
* Prints out the alphabet in lower case and reverse order
*
* A refresher on C; Learn C The hard way; 1.2
*/
#include <unistd.h>
void my_putchar(char c)
{
class lol(object):
def __eq__(self, other):
return True
a = lol()
if (a == 1 and a == 2 and a ==3):
print("Wai hallo dere")
@andeh575
andeh575 / Proof Passing.hs
Created January 3, 2018 15:16
Proof Passing created by andeh575 - https://repl.it/@andeh575/Proof-Passing
-- Experimenting with emulation of dependently typed languages
-- Limitations:
-- Without being able to statically guarantee that some number is never 0
-- then it's necessary to utilize the isPos type (which means we also need
-- to define addition on PosNat S). A dependently typed language would
-- greatly simplify this process and prevent the definitions of types from
-- growing out of control.
-- Define the natural numbers using Peano arithmetic
data Nat = Z | S Nat
@andeh575
andeh575 / palindrome.java
Created December 9, 2017 05:29
Palindromes
// Problem: For loop challenge 2
import java.util.Scanner;
class Main {
public static void main(String[] args) {
Scanner inp = new Scanner(System.in);
System.out.print("In:");
String s = inp.nextLine();
@andeh575
andeh575 / simpleFib.java
Last active December 9, 2017 05:18
Naive fibonacci sequence in java
// Problem: For loop challenge 1
import java.util.Scanner;
class Main {
public static void main(String[] args) {
Scanner inp = new Scanner(System.in);
System.out.print("In:");
int x = inp.nextInt();
@andeh575
andeh575 / cAmElPrInT.java
Last active December 9, 2017 05:02
Camel Printing
// Problem: Further for loop 7
import java.util.Scanner;
class Main {
public static void main(String[] args) {
Scanner inp = new Scanner(System.in);
System.out.print("In:");
String s = inp.nextLine();
@andeh575
andeh575 / conditional.java
Last active December 4, 2017 14:44
Conditional Statements
// Problem: Conditional Statement Practice 4
import java.util.Scanner;
class Main {
public static void main(String[] args) {
Scanner inp = new Scanner(System.in);
System.out.print("In:");
String word = inp.nextLine();