This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
participants = [ | |
# Participants here | |
] | |
winners = [] | |
while len(winners) < 4: | |
c = random.choice(participants) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Uses this image: http://dl.dropbox.com/u/5768678/minecraft-sprites/blocks.png */ | |
.block { | |
background-image: url('blocks.png'); | |
width: 32px; | |
height: 32px; | |
} | |
#cobblestone { background-position: 0px 0px; } | |
#stone-bricks-1 { background-position: 0px -32px; } | |
#lapis-lazuli-block { background-position: 0px -64px; } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE HTML> | |
<html lang="en-US"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Hexmap Test</title> | |
</head> | |
<body> | |
<canvas width="500" height="500" id="board" style="border:1px solid black; padding: 1em;"></canvas> | |
<script src="hexmap.js"></script> | |
</body> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import pygame | |
from pygame.locals import * | |
##### Rendering Fuctions ##### | |
def drawGrid(context, width, height, cell_size): | |
column = 1 | |
row = 0 | |
at = 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var hexmap = function(paper_x, paper_y, width, height, hex_radius) { | |
var paper = Raphael(paper_x, paper_y, width, height); | |
var grid_width = Math.round(paper.width/(hex_radius*2)); | |
var grid_height = Math.round(paper.height/(hex_radius*2)); | |
var x, y, column_mult; | |
var row_mult = 0; | |
for (var row=1;row<=grid_height;row++) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import textwrap | |
wrapper = textwrap.TextWrapper(width=50,subsequent_indent=' '*13) | |
class Item(object): | |
def __init__(self, name, description='No description.'): | |
self.name = name | |
self.description = description | |
def display(self): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE HTML> | |
<html lang="en-US"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Kanagrinder</title> | |
<!-- Styles --> | |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/1.4.0/css/bootstrap.min.css"> | |
<style type="text/css"> | |
td { text-align: center; } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import generators | |
class priorityDictionary(dict): | |
def __init__(self): | |
'''Initialize priorityDictionary by creating binary heap | |
of pairs (value,key). Note that changing or removing a dict entry will | |
not remove the old pair from the heap until it is found by smallest() or | |
until the heap is rebuilt.''' | |
self.__heap = [] | |
dict.__init__(self) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE HTML> | |
<html lang="en-US"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Todo Demo</title> | |
<script> | |
window.onload = function() { | |
var item, complete, list; | |
list = document.getElementById('list'); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.signedlongint.tropiary; | |
import android.app.Activity; | |
import android.os.Bundle; | |
import android.view.View; | |
import android.widget.Button; | |
public class TropiaryStart extends Activity implements View.OnClickListener { | |
Button bSearch, bSaved, bRandom; |