Skip to content

Instantly share code, notes, and snippets.

Chih-Hsuan Kuo kuoe0

Block or report user

Report or block kuoe0

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Prolog.bnf
<program> ::= <clause list> <query> | <query>
<clause list> ::= <clause> | <clause list> <clause>
<clause> ::= <predicate> . | <predicate> :- <predicate list>.
<predicate list> ::= <predicate> | <predicate list> , <predicate>
<predicate> ::= <atom> | <atom> ( <term list> )
<term list> ::= <term> | <term list> , <term>
<term> ::= <numeral> | <atom> | <variable> | <structure>
<structure> ::= <atom> ( <term list> )
<query> ::= ?- <predicate list>.
<atom> ::= <small atom> | ' <string> '
View 3767-I_Wanna_Go_Home.cpp
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <vector>
#include <queue>
#include <cstring>
using namespace std;
#define MAXN 610
@kuoe0
kuoe0 / sudoku_solver.pl
Last active Dec 20, 2015
sudoku solver with Prolog
View sudoku_solver.pl
%=============================================================================
% FileName: sudoku_solver.pl
% Desc: sudoku solver
% Environment: Mac OS X 10.8.2, SWI-Prolog 6.2.6
% Usage: swipl -q -s sudoku_solver.pl
% Input: Enter all number in one line and seperate by one space. 0 denote the empty element.
% Output: Show all number in one line and seperate by one space.
% Author: KuoE0
% Email: kuoe0.tw@gmail.com
% HomePage: http://kuoe0.ch/
@kuoe0
kuoe0 / expr.lsp
Last active Dec 17, 2015
Common Lisp - Convert infix expression to postfix expression
View expr.lsp
#! /usr/bin/env sbcl --script
;;; Filename: expr.lsp
;;; Author: KuoE0 <kuoe0.tw@gmail.com>
;;; Description: Convert infix expression to postfix expression
;;;
;;; Distruted under terms of the BSD license.
; split string by one space
(defun split-by-space (str)
(let ((len (length str))
@kuoe0
kuoe0 / brew_version.sh
Last active Dec 16, 2015
install specific version formula with homebrew
View brew_version.sh
#=============================================================================
# FileName: brew_version
# Desc: install specific version formula with homebrew
# Usage: brew_version <formula> <version> [param1 param2 ...]
# Author: KuoE0
# Email: kuoe0.tw@gmail.com
# HomePage: http://kuoe0.ch/
#=============================================================================
# /usr/bin/env bash
@kuoe0
kuoe0 / qround - c - Fair and Square.py
Created Apr 14, 2013
Google Code 2013 - Qualification Round - C - Fair and Square
View qround - c - Fair and Square.py
#! /usr/local/bin/python
# -*- coding: utf-8 -*-
import math
palin = []
max_digit = 0
def isPalindrome( number ):
@kuoe0
kuoe0 / qround - b - Lawnmower.cpp
Created Apr 14, 2013
Google Code Jam 2013 - Qualification Round - B - Lawnmower
View qround - b - Lawnmower.cpp
/*=============================================================================
# FileName: qround - b - Lawnmower.cpp
# Desc: Google Code Jam 2013 - Qualification Round - B - Lawnmower
# Author: KuoE0
# Email: kuoe0.tw@gmail.com
# HomePage: http://kuoe0.ch/
# Version: 0.0.1
# LastChange: 2013-04-14 16:17:59
# History:
=============================================================================*/
@kuoe0
kuoe0 / qround - a - Tic-Tac-Toe-Tomek.cpp
Last active Dec 16, 2015
Google Code Jam - Qualification Round - A - Tic-Tac-Toe-Tomek
View qround - a - Tic-Tac-Toe-Tomek.cpp
/*=============================================================================
# FileName: qround - a - Tic-Tac-Toe-Tomek.cpp
# Desc: Google Code Jam - Qualification Round - A - Tic-Tac-Toe-Tomek
# Author: KuoE0
# Email: kuoe0.tw@gmail.com
# HomePage: http://kuoe0.ch/
# Version: 0.0.1
# LastChange: 2013-04-14 16:19:38
# History:
=============================================================================*/
View quickSort-in-place.cpp
/*=============================================================================
# FileName: quickSort.cpp
# Desc: Quick Sort
# Author: KuoE0
# Email: kuoe0.tw@gmail.com
# HomePage: http://kuoe0.ch/
# Version: 0.0.1
# LastChange: 2013-03-05 03:17:47
# History:
=============================================================================*/
View mergeSort-natural.cpp
/*=============================================================================
# FileName: mergeSort.cpp
# Desc: Natural Merge Sort
# Author: KuoE0
# Email: kuoe0.tw@gmail.com
# HomePage: http://kuoe0.ch/
# Version: 0.0.1
# LastChange: 2013-03-05 02:55:56
# History:
=============================================================================*/
You can’t perform that action at this time.