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
# MARS recursive factorial | |
# Sat Feb 15 12:50:25 EST 2014 | |
.data | |
title: .asciiz "factorials\n==========\n\n" | |
nfactis: .asciiz "! is " | |
newline: .asciiz "\n" | |
.text |
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
/* | |
* trying to practice AVL trees | |
* | |
* input: numeric keys separated by newlines | |
* output: s-expression for final AVL tree, | |
* where nodes have format v=VALUE,h=HEIGHT | |
* | |
* Sun Jan 19 00:48:59 EST 2014 | |
*/ |
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
# | |
# 2d platformer slope platform demo | |
# written to try to to help out someone on IRC | |
# | |
# controls: | |
# - left and right keyboard cursor keys: horizontal walking movement | |
# - up arrow cursor keyboard key: jump | |
# | |
# blockeduser | |
# Tue Dec 24 15:03:09 EST 2013 |
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
# Gaussian elimination | |
# -- fractional datatype version | |
# -- deluxe big integers and expressions edition | |
# | |
# By blockeduser the wannabe programmer | |
# Original clown version: September 1-3, 2012 | |
# Python Deluxe big integers version: September 14, 2013 | |
import sys | |
import re |
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
# Open .exe files in mono or wine depending | |
# on what the file(1) command says. Useful | |
# for practical double-clicking from a | |
# file manager. | |
if [ ! "$1" ] | |
then | |
echo "Use: $0 file" | |
exit 1 | |
fi |
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
# Open .exe files in mono or wine depending | |
# on what the file(1) command says. Useful | |
# for practical double-clicking from a | |
# file manager. | |
if [ ! $1 ] | |
then | |
echo "Use: $0 file" | |
exit 1 | |
fi |
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 program gives either "N - 2" terms of the | |
* series for e, or "N" decimal places of e | |
* (in the latter case converting the digit count | |
* to a term count by brute-force) using only C's | |
* built-in integer arithmetic (lots of it and lots | |
* of memory allocation and moving-around stuff). | |
* In both cases, it makes sure to stop giving | |
* you digits once the error margin is reached. | |
* |
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
# Print e, (believed) correct to N decimal places. | |
# | |
# [Not absolutely guaranteed accurate, because | |
# I'm not an expert or professional. Casually | |
# believed to work based on tests with N < 3000 | |
# with some e-decimals sources on the Internet.] | |
# | |
# [e.g. to get identical formatting for comparison | |
# with NASA's "e.2mil", pipe through | |
# sed 's/2\./ 2\./g' | fold -60 |
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
/* | |
* September 6, 2012 | |
* - Fixed $ compilation | |
* - Better pictures | |
*/ | |
/* | |
* August 27, 2012 error fixes: | |
* | |
* Fixed + compilation to work properly with |
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
#lang racket | |
; Prints out perfect numbers < 1000 | |
(define (proper-factors-of n) | |
(filter | |
(lambda (x) (= 0 (modulo n x))) | |
; n is excluded | |
(sequence->list (in-range 1 n)))) |
NewerOlder