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
$(document).ready(function() | |
{ | |
} | |
); |
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
''' | |
The algorithm works as follows: | |
It simply checks all positions, with positions being marked with None (unknown) x (part of a ship) or o (no ship) | |
Because the description says that ships can't touch (including diagonally) you know for sure that if a position | |
has the part of a ship that the positions diagonal to it don't, like so: | |
o.o | |
.x. | |
o.o |
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
# encoding: UTF-8 | |
TodoItem = Struct.new(:done, :contents) | |
todos = [] | |
if File.exists? 'list.td' | |
File.open('list.td') do |f| | |
todos = f.read.split("\n") | |
todos.map! { |item| | |
new_item = TodoItem.new | |
new_item.done, new_item.contents = item.split("|") | |
new_item |
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
# encoding: UTF-8 | |
module BoukeTodoApp | |
class TodoList | |
def initialize(filename) | |
@items = [] | |
@filename = filename | |
self.load | |
end |
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
#!/bin/bash | |
if [ $# -lt 1 ] | |
then | |
echo "Needs program filename argument" | |
exit 1 | |
fi | |
executable=`mktemp` | |
echo "Testing $1" | |
echo |
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
#include <string> | |
#include <algorithm> | |
#include <list> | |
#include <cstring> | |
#include <fstream> | |
#include <iostream> | |
#include <cctype> | |
#include <vector> | |
#include <set> |
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
9,12d8 | |
< celt | |
< celts | |
< ceres | |
< cerf | |
15,17d10 | |
< cf | |
< ci | |
< cipro | |
23d15 |
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
77a78,79 | |
> coke | |
> cokes | |
84a87 | |
> collier | |
89a93 | |
> colt | |
157a162 | |
> cote | |
186a192 |
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
mapping = { | |
'>': '++p;', | |
'<': '--p;', | |
'+': '++*p;', | |
'-': '--*p;', | |
'.': 'putchar(*p);', | |
',': '*p=getchar();', | |
'[': 'while (*p) {', | |
']': '}' | |
} |
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
import Data.List (insert) | |
fst3 (x,_,_) = x | |
snd3 (_,x,_) = x | |
trd3 (_,_,x) = x | |
toTuple2Int :: String -> (Int, Int) | |
toTuple2Int s = (read $ takeWhile (/=' ') s :: Int, read $ dropWhile (==' ') $ dropWhile (/=' ') s :: Int) | |
toTupleTuple2Int :: String -> (Int, (Int, Int)) |
OlderNewer