Skip to content

Instantly share code, notes, and snippets.

@markson
markson / chest game
Created October 15, 2012 07:00
Chest game public
import ipdb
import re
import sys
PROMPT_SIZE = "Board size: "
ERROR_SIZE = "Size must be an odd number between 5 and 9"
PROMPT_MOVE_X = "Player X, enter move: " # Or player Y ...
PROMPT_MOVE_Y = "Player Y, enter move: " # Or player Y ...
ERROR_MOVE_LENGTH = "Move must be 5 characters"
ERROR_MOVE_PIECE ="Error move piece" # e.g player X can not move piece "Y" or piece that was used by the opponent in his/her last move.
ERROR_MOVE_POSITION = "Invalid position" # you can't place your player on occupied position, or place S on "T", or go over the board
@markson
markson / a.rb
Created September 15, 2012 03:34
this is the test of jist
$ jist a.rb
https://gist.github.com/0d07bc98c139810a4075
By default it reads from STDIN, and you can set a filename with -f.
$ jist -f test.rb <a.rb
https://gist.github.com/7db51bb5f4f35c480fc8
Alternatively, you can just paste from the clipboard:
$ jist -P
https://gist.github.com/6a330a11a0db8e52a6ee
@markson
markson / getpid.c
Created August 6, 2012 02:37
Test the getpid() function
#include <stdio.h>
#include <sys/types.h>
int main(void){
pid_t this_process;
this_process = getpid();
printf("this process value is %d and hex value if 0x%x\n", this_process,this_process);
}