Skip to content

Instantly share code, notes, and snippets.

View lunacodes's full-sized avatar

Luna Lunapiena lunacodes

View GitHub Profile
@lunacodes
lunacodes / tic tac toe.py
Created January 20, 2015 16:39
tic tac toe.py
import random
def drawBoard(board):
print(' | |')
print(' ' + board[7] + ' | ' + board[8] + ' | ' + board[9])
print(' | |')
print('-----------')
print(' | |')
print(' ' + board[4] + ' | ' + board[5] + ' | ' + board[6])
import pygame, sys
from pygame.locals import *
from pygame.draw import rect as square
winWidth = 600
winHeight = 600
black = ( 0, 0, 0)
green = ( 0, 255, 0)
import pygame, sys
from pygame.locals import *
from pygame.draw import rect as square
winWidth = 800
winHeight = 800
black = (0, 0, 0)
everything = pygame.sprite.Group()
import pygame, sys
from pygame.locals import *
winwidth = 800
winheight = 800
wallwidth = winwidth * .4
wallheight = winheight * .4
gameDisplay = pygame.display.set_mode((winwidth, winheight))
@lunacodes
lunacodes / tic tac toe.py
Last active August 29, 2015 14:17
Tic Tac Toe
"""Note:
There is currently one known bug in this game:
If the player prematurely presses Enter, without inputting a Move - the game will crash - due to receiving a literal instead of an int
"""
import random
#Board constructed from strings. Each board position contains the letter chosen by the player
def drawBoard(board):
@lunacodes
lunacodes / game2.py
Last active August 29, 2015 14:19
Shitty Python Sketch
"""
The point of this incarnation of the game is that there will be 3 areas for the player to explore, all connected by a center field.
Tasks:
Setup D-pad so that the image rotates with each direction
Get Monsters moving
Make Volume Control function do Pause instead???
#Come up with Loop or List system for Text Parsing
#Implement Pause function
@lunacodes
lunacodes / tictactoe.py
Created June 9, 2015 03:36
Tic Tac Toe
"""As I mentioned, a lot of this was initially derived from Making Games with Python by Al Sweigart"""
import random
def drawBoard(board):
print ' | ' + ' | '
print ' ' + board[7] + ' | ' + board[8] + ' | ' + board[9]
print ' | ' + ' | '
print '-----------'
@lunacodes
lunacodes / TicTacToePygame.py
Created June 11, 2015 08:08
Tic Tac Toe Using Pygame
import pygame, sys
from pygame.locals import *
green = (0, 255, 0)
red = (255, 0, 0)
black = (0, 0, 0)
winWidth = 600
winHeight = 600
@lunacodes
lunacodes / single.php
Created July 27, 2015 15:31
Single Posts Template I'm trying to modify to exclude sidebar based on post-category - refer to the code in section Line 3
<?php get_header(); ?>
<div class="row">
<div class="col-sm-12">
<?php get_sidebar(); ?>
</div>
</div>
<div class="row">
@lunacodes
lunacodes / movie_selector.gist
Created August 11, 2015 02:19
Dict Problem
user_action_dict = {'add' : 'add_movie_to_list',
'choose' : 'movie_selection',
'delete' : 'delete_movie_from_list',
'view Movies' : 'print_available_movie_dict',
'view Played' : 'print_played_movie_list',
}
available_movie_dict = {}
available_movie_dict2 = {'name' : 'Buffy', 'name2' : 'Angel', 'name3' : 'Spike'}