View client.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <sys/types.h> | |
#include <sys/socket.h> | |
#include <netinet/in.h> | |
#include <arpa/inet.h> | |
#define BUFSZ 256 |
View vacuum.rkt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#lang racket | |
; CS3243 Vacuum Cleaner world simulation using Racket Scheme | |
; Initially written by Yong Chun How | |
; Modified by Pang Yan Han | |
; Helper functions | |
(define (accumulate op initial sequence) | |
(if (null? sequence) | |
initial |
View stfreq.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import sys | |
def run(): | |
'''Reads in series of integers and ranges, then outputs frequencies | |
Input format: | |
1st line - 2 integers R and C, indicating the rows and columns of data | |
that follows |
View scale.lisp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defparameter *max-weight* 40) | |
(defparameter *max-stones* 4) | |
(defparameter *stone-indices* (loop for i from 0 to (1- *max-stones*) collect i)) | |
(defun generate-combos () | |
(let ((all-combos ()) | |
(a-limit (- *max-weight* (1- *max-stones*)))) | |
(do ((a 1 (1+ a))) | |
((> a a-limit) all-combos) | |
(do ((b 1 (1+ b))) |
View ascii_birthday.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#define TOP_START 24 | |
#define TOP_END 55 | |
#define MID_START 15 | |
#define MID_END 63 | |
#define BOT_START 13 | |
#define BOT_END 66 | |
#define MAIN(foobar) int main(void) { foobar } |