Skip to content

Instantly share code, notes, and snippets.

@sanchitgangwar
sanchitgangwar / snake.py
Created March 22, 2012 12:38
Snakes Game using Python
# SNAKES GAME
# Use ARROW KEYS to play, SPACE BAR for pausing/resuming and Esc Key for exiting
import curses
from curses import KEY_RIGHT, KEY_LEFT, KEY_UP, KEY_DOWN
from random import randint
curses.initscr()
win = curses.newwin(20, 60, 0, 0)
@rpip
rpip / tictactoe.py
Last active October 23, 2021 01:49
Simple Python implementation of the classic Tic Tac Toe game. Goal : Unbeatable AI.
#!/usr/bin/env python
#--------------------------------------------------------------------------
# Tic Tac Toe game in Python
# Author: Mawuli Adzaku <[email protected]>
# Date: 20-05-2013
# Tested with Python 2.7
# TO RUN:
# sudo chmod a+x tictactoe.py
# ./tictactoe.py
# OR JUST RUN : python tictactoe.py