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
module Main | |
(main | |
) where | |
import Text.Parsec hiding (State (..)) | |
import Text.Parsec.String | |
import Control.Monad.State |
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
" Welcome to the wonderful world of my .vimrc | |
filetype off | |
set rtp+=~/.vim/bundle/Vundle.vim | |
call vundle#begin() | |
Plugin 'VundleVim/Vundle.vim' " Plugin manager |
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
hello |
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
[package] | |
name = "MandelbrotImage" | |
version = "0.1.0" | |
authors = ["Johnathan Walker <jhwalking0@gmail.com>"] | |
[dependencies] | |
image = "*" | |
num = "*" |
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
extern crate image; | |
extern crate num; | |
use std::fs::File; | |
use std::path::Path; | |
use num::Complex; | |
// a function which takes a borrowed Complex<f32> and checks if its within | |
// the bounds of the mandelbrot set |
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
#[inline(three_and_five)] | |
fn three_and_five() -> usize { | |
(1..1000).filter(|x| { x % 3 == 0 || x % 5 == 0 }).sum() | |
} | |
#[inline(fib)] | |
fn fib() -> usize { | |
struct Fib { | |
curr : usize, | |
next : usize, |
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
use std::io; | |
fn main() { | |
let mut stdin = io::stdin(); | |
let input = &mut String::new(); | |
input.clear(); | |
println!("Specific impulse: "); | |
stdin.read_line(input).unwrap(); | |
let specific_impulse = input.trim().parse::<i32>().unwrap(); |
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
use std::io; | |
fn main() { | |
let mut stdin = io::stdin(); | |
let input = &mut String::new(); | |
input.clear(); | |
println!("Specific impulse: "); | |
stdin.read_line(input).unwrap(); | |
let specific_impulse = input.trim().parse::<i32>().unwrap(); |
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
extern crate sdl2; | |
extern crate noise; | |
use sdl2::event::Event; | |
use sdl2::keyboard::Keycode; | |
use sdl2::rect::Rect; | |
use noise::{NoiseModule, Perlin}; | |
use noise::Seedable; |
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
data Expr = DeBruijn Int | |
| App Expr Expr | |
| Lambda Expr deriving Show | |
eval :: Expr -> Expr | |
eval (App (Lambda body) arg) = (arg `captureIn` body) 0 | |
eval (App (App lhs rhs) arg) = eval $ App (eval (App lhs rhs)) arg | |
eval a = a |
OlderNewer