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
// GridC to GridLang compiler | |
// https://github.com/lessandro/gridc | |
void cell_resource() { } | |
void cell_empty() { } | |
void cell_robot() { } | |
int NORTH; | |
int EAST; | |
int SOUTH; |
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
// GridC to GridLang compiler | |
// https://github.com/lessandro/gridc | |
void eat(dir) { | |
if (ffi(@LOOK, dir) == @CELL_ROBOT) ffi(@PUNCH, dir); | |
if (ffi(@LOOK, dir) == @CELL_RESOURCE) ffi(@PULL, dir); | |
} | |
void eat_all() { | |
eat(@NORTH); |
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
CALL << @main | |
END | |
@move1 | |
# assign dir | |
# call rand | |
PUSH 3 | |
RAND | |
# call equal | |
# ["dir"] |
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 java.util.ArrayList; | |
import java.util.List; | |
import java.util.concurrent.Callable; | |
import android.os.AsyncTask; | |
import android.util.Log; | |
public class Promise<T> { | |
private List<Callback<T>> callbacks = new ArrayList<Callback<T>>(); |
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
class Solver(object): | |
def __init__(self, coins): | |
self.coins = coins | |
self.path = {} | |
self.memo = {} | |
def cost(self, cents): | |
if cents == 0: | |
return 0 |
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 <iostream> | |
#include <vector> | |
#include <map> | |
#include <queue> | |
#define foreach(x, it) for (typeof(x.begin()) it = x.begin(); it != x.end(); ++it) | |
#define WORD_SIZE 5 | |
using namespace std; |
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
class Dictdb: | |
def __init__(self): | |
self.db = {} | |
self.rdb = {} | |
self.rdiff = [] | |
def rinc(self, val): | |
if val not in self.rdb: | |
self.rdb[val] = 0 | |
self.rdb[val] += 1 |
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.Char (ord) | |
import Data.List (sort, group, intersperse) | |
import Text.ParserCombinators.Parsec | |
-- types | |
type Card = Int | |
type Suit = Int | |
type SuitCard = Int |
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
class A | |
{ | |
private int memberint; | |
public int someMethod(int memberint) | |
{ | |
// memberint being shadowed by the parameter | |
this.memberint = memberint; | |
} |
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
0 | |
2 | |
7 | |
2 | |
5 8 | |
2 3 | |
1 6 | |
5 | |
4 | |
0 |