Skip to content

Instantly share code, notes, and snippets.

@johshoff
johshoff / tictactoe.py
Last active August 29, 2015 14:10 — forked from maghoff/tictactoe.py
# Python 3!
import random
def show(board):
print('+---+')
print('|%s|' % board[0:3])
print('|%s|' % board[3:6])
print('|%s|' % board[6:9])
print('+---+')
@johshoff
johshoff / new_bashrc.sh
Created August 11, 2012 11:05 — forked from josephwecker/new_bashrc.sh
Replace .bashrc, .bash_profile, .profile, etc. with something much more clean, consistent, and meaningful.
#!/bin/bash
# License: Public Domain.
# Author: Joseph Wecker, 2012
#
# Are you tired of trying to remember what .bashrc does vs .bash_profile vs .profile?
# Are you tired of trying to remember how darwin/mac-osx treat them differently from linux?
# Are you tired of not having your ~/.bash* stuff work the way you expect?
#
# Symlink all of the following to this file:
# * ~/.bashrc
(ns tetris
(:import
(javax.swing JFrame)
(java.awt Canvas Graphics Dimension Color Polygon GraphicsEnvironment Transparency Toolkit)
(java.awt.image BufferStrategy BufferedImage PixelGrabber WritableRaster)
(java.awt.event ActionListener KeyListener KeyEvent))
(:gen-class))
(def *cols* 10)
(def *rows* 20)