Skip to content

Instantly share code, notes, and snippets.

@hanst99
hanst99 / level53.txt
Created April 2, 2019 19:30
Fast solution for level 53
-- 7 Billion Humans (2214M) --
-- 53: 100 Cubes on the Floor --
a:
step w
if c != datacube:
jump a
endif
if n == wall:
mem1 = set 99
@hanst99
hanst99 / clipboard.txt
Created April 2, 2019 00:44
7 billion humans calc average (short & slow)
-- 7 Billion Humans (2214M) --
-- 54: Terrain Leveler --
a:
if n != wall:
step n
mem1 = calc mem1 + c
jump a
endif
step s
@hanst99
hanst99 / clipboard.txt
Created April 2, 2019 00:34
7 billion humans calc average
-- 7 Billion Humans (2214M) --
-- 54: Terrain Leveler --
comment 0
a:
if n != wall:
step n
mem1 = calc mem1 + c
jump a
endif
let args = Sys.argv;;
let in_files = if Array.length args == 1
then [|stdin|]
else Array.map open_in (Array.sub args 1 (Array.length args - 1));;
Array.iter (fun c ->
try while true do
print_endline (input_line c)
done with
End_of_file -> close_in c;
@hanst99
hanst99 / MIME.hs
Created February 11, 2016 21:18
Mime types, too slow
import System.IO
import Control.Monad
import qualified Data.Map as M
import Data.Map(Map)
import Data.Maybe
import Control.Applicative
import Data.Char
import qualified Data.Text as T
import qualified Data.Text.IO as T
import Data.Text(Text)
@hanst99
hanst99 / quicksort.nim
Created July 31, 2015 21:51
Nim quicksort
## Swap xs[ix] and xs[iy]
proc swap[A](xs: var seq[A], ix: int, iy: int) =
let tmp = xs[ix]
xs[ix] = xs[iy]
xs[iy] = tmp
## 'Pivotizes' the seq by rearranging the seq
## such that there is an index i with value vi
## so that if j < i then vj < vi and if
## j > i then vj >= vi
@hanst99
hanst99 / CMakeLists.txt
Last active August 29, 2015 14:13
Project build weirdness
cmake_minimum_required(VERSION 2.8.4)
project(LuaAPI)
# ignore this please, this part is here to deal with CLion nonsense
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}\\build")
include_directories(SYSTEM "E:\\lib\\include")
link_directories(SYSTEM "E:\\lib\\lib")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")