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
(def world [[ 1 1 1 1 1] | |
[999 999 999 999 1] | |
[ 1 1 1 1 1] | |
[ 1 999 999 999 999] | |
[ 1 1 1 1 1]]) | |
(defn estimate-cost [step-cost-est size y x] | |
(* step-cost-est (- (+ size size) y x 2))) | |
(defn path-cost [node-cost cheapest-nbr] |
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
(defn primes [] | |
(map #(last (last %)) | |
(iterate | |
(fn [[n prime-list]] | |
(if (every? false? (map #(= 0 (mod n %)) prime-list)) | |
[(inc n) (conj prime-list n)] | |
(recur [(inc n) prime-list]))) | |
[3 [2]]))) |
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
; ModuleID = 'tests/hello_world.f' | |
target datalayout = "e-p:64:64:64-S128-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-f128:128:128-n8:16:32:64" | |
target triple = "x86_64-apple-darwin11" | |
%struct.__st_parameter_dt = type { %struct.__st_parameter_common, i64, i64*, i64*, i8*, i8*, i32, i32, i8*, i8*, i32, i32, i8*, [256 x i8], i32*, i64, i8*, i32, i32, i8*, i8*, i32, i32, i8*, i8*, i32, i32, i8*, i8*, i32, [4 x i8] } | |
%struct.__st_parameter_common = type { i32, i32, i8*, i32, i32, i8*, i32* } | |
@.cst = linker_private constant [20 x i8] c"tests/hello_world.f\00", align 8 | |
@.cst1 = linker_private constant [12 x i8] c"Hello World!", align 8 | |
@options.1.1541 = internal constant [8 x i32] [i32 68, i32 511, i32 0, i32 0, i32 0, i32 1, i32 0, i32 1], align 32 |
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
????? 8???__text__TEXT??X ?__const__TEXT?`?__eh_frame__TEXT x? | |
p? h? | |
UH??H???H?? ???H?H??(???Dž0???Dž ????Dž$????H?? ???H?5? | |
?H?? ????H???]?UH??H?? ?}?H?u?}?H?u?}?H?u?}?H?u??H?5???E??E?H?? ]?tests/hello_world.fHello World!D?zRx | |
?-??????-?-c ?,????????p? | |
-W | |
-M? | |
-??????? ?8Rp?hXl9__gfortran_st_write__gfortran_transfer_character_write__gfortran_st_write_done_main__gfortran_set_args__gfortran_set_options_main.eh_MAIN__l_.cstl_.cst1_options.1.1541EH_frame0_MAIN__.eh |
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
//Used to bootstrap way up. | |
var zero = "+[]"; | |
//Puts the goob into an array. | |
var intoArray = function(goobString){ | |
return "["+goobString+"]"; | |
}; | |
//Uses the zero variable to grab the zeroth element of the array. | |
var zeroIndex= function (goobString){ |
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
Zacks-MacBook-Air:emscripten zackmaril$ ./emfortran tests/hello_world.f | |
(Emscripten: Running sanity checks) | |
WARNING: Closure compiler (/Users/zackmaril/Dev/closure-compiler/compiler.jar) does not exist, check the paths in ~/.emscripten. -O2 and above will fail | |
llvm_nm ? | |
/Users/zackmaril/Projects/Ravascrip/clang+llvm-3.0-x86_64-apple-darwin11/bin/llvm-nm: /var/folders/dy/7_v800lx5ss16j5m9yddq08m0000gn/T/tmpa_V25V/hello_world.o: unrecognizable file type | |
llvm_nm ? | |
/Users/zackmaril/Projects/Ravascrip/clang+llvm-3.0-x86_64-apple-darwin11/bin/llvm-dis: Invalid bitcode signature | |
Traceback (most recent call last): | |
File "/Users/zackmaril/Projects/Ravascrip/emscripten/emscripten.py", line 278, in <module> | |
temp_files.run_and_clean(lambda: main(keywords)) |
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
I 0.061428573 | |
to 0.045714285 | |
and 0.04142857 | |
the 0.03 | |
of 0.021428572 | |
in 0.015714286 | |
a 0.014285714 | |
am 0.012857143 | |
as 0.011428571 | |
have 0.011428571 |
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
//Increase the list by one and does carry over between digits. | |
var increaseByOne = function(listOfWeights){ | |
var newList = listOfWeights; | |
newList[newList.length-1] += 1; | |
for(var i = listOfWeights.length-1; i>0; i--){ | |
var newWeight= listOfWeights[i]; | |
if(newWeight==2){ | |
newWeight=-1; | |
newList[i-1]+= 1; | |
} |
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 strict"; | |
// This is one of my favorite javascript tricks. It shows off some of the weird | |
// parts of the language in a pretty straightforward way. With only three | |
// characaters, '+', '[' and ']', we can encode any natural number we want in javascript. For | |
// the math minded, this was inspiried by Peano's Axioms and javascript's type conversions. | |
// http://mathworld.wolfram.com/PeanosAxioms.html | |
// This file uses es6, run it by doing `node --harmony peano.js` |
OlderNewer