Skip to content

Instantly share code, notes, and snippets.

View osoleve's full-sized avatar
👾

osoleve

👾
View GitHub Profile
@osoleve
osoleve / Sine in Scheme
Created March 18, 2011 04:44
Simple function (and helper function) to calculate Sine using Scheme
(define (factorial n)
(if (= n 0)
1
(* n (factorial (- n 1)))))
(define (sine x . n)
(cond ((not (null? n))
(cond ((< 13 (car n))
0)
(else (- (/ (expt x (car n)) (factorial (car n)))
@osoleve
osoleve / TicTacToe.lisp
Created October 30, 2010 18:53
A simple two player textual implementation of Tic Tac Toe.
;;;; tictactoe.lisp
;;;;
;;;; Andrew Levenson
;;;; 10/27/10
;;;;
;;;; Simple two player ASCII Tic Tac Toe Game
;;; First player is X, so initialize the marker to X
(setf *marker* :X)
(setf *player* "Player 1")