#!/bin/sh

#    Pybik -- A 3 dimensional magic cube game.
#    Copyright (C) 2009  B. Clausius
#
#    This program is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation, either version 3 of the License, or
#    (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.

cd pybiklib

case $1 in
    py)
        shift
        python pybik.py --solved --pure-python --debug=2 "$@"
        ;;
    c)
        shift
        python pybik.py --solved --debug=2 "$@"
        ;;
    profile-py)
        shift
        python ../tools/profile.py -r -f ../tools/display-py.tmp
        python ../tools/profile.py -o -f ../tools/display-py.tmp -n display >>../tools/display.log
        ;;
    profile-c)
        shift
        python ../tools/profile.py -r -x -f ../tools/display-c.tmp
        python ../tools/profile.py -o -x -f ../tools/display-c.tmp -n display >>../tools/display.log
        ;;
    profile-cmp)
        shift
        python ../tools/profile.py -o -f ../tools/display-py.tmp -n display
        python ../tools/profile.py -o -x -f ../tools/display-c.tmp -n display
        ;;
    profile-log)
        less +G ../tools/display.log
        ;;
    *)
        python pybik.py "$@"
        ;;
esac
