This file contains hidden or 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 <stdbool.h> | |
/* Constants */ | |
#define NUMBER_OF_TESTS 4 | |
#define A 0 | |
#define B 1 | |
void And (bool a, bool b, bool *out) { |
This file contains hidden or 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
(define repeat | |
(λ (times) | |
(λ (n) | |
(cond | |
[(zero? times) | |
'()] | |
[else | |
(cons n ((repeat (sub1 times)) n))])))) |
This file contains hidden or 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
;; This is written in the full Racket language. | |
#lang racket | |
(require rackunit rackunit/text-ui) | |
;; I'll use this definition so tests fail. | |
;; Replace it with a correct expression in the questions below. | |
(define FIXME 'FIXME) | |
;; You can paste this Gist into Dr. Racket and | |
;; complete your definitions there. |
This file contains hidden or 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
#!/bin/bash | |
echo Downloading TinyASM | |
pushd /tmp | |
if [ -f tiny.tar.gz ] | |
then | |
rm -f tiny.tar.gz | |
fi | |
curl -o tiny.tar.gz http://jadud.com/teaching/comporg-f14/resources/tiny.tar.gz | |
tar xvzf tiny.tar.gz |
This file contains hidden or 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
/* EALU starter file for CSC 335 Midterm Checkup. | |
* CC0 2014 by Matt Jadud | |
* Compile with: | |
* gcc -o ealu ealu.c | |
* and execute then with | |
* ./ealu | |
*/ | |
#include <stdint.h> | |
#include <stdio.h> |
This file contains hidden or 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
all: | |
gcc -o demo -std=gnu99 demo.c |
This file contains hidden or 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
/* A short FizzBuzz implementation, primarily for | |
demonstration of some of the features of C. | |
To compile this program, at the terminal, type: | |
gcc fizzbuzz.c | |
which will give you the executable "a.out". | |
To run it, type: | |
This file contains hidden or 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
# QUESTIONS FOR CONSIDERATION | |
# | |
CFLAGS=-std=c99 -Wall -g | |
test: square | |
gcc ${CFLAGS} -o square_test square.o square_test.c | |
encoder: square | |
gcc ${CFLAGS} -o encoder square.o encoder.c | |
This file contains hidden or 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 <stdint.h> | |
void main () { | |
uint8_t a, b, out; | |
a = 42; | |
b = 2; | |
out = a & b; |
This file contains hidden or 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> | |
void main () { | |
byte b; | |
b = 1; | |
} |