This file contains 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
# required in process.env: host, cloudant_account, cloudant_key, cloudant_pass, | |
# cloudant_db_accounts, cloudant_db_data, cookie_secret, redis_url, redis_port, redis_path, | |
# smtp_email, smtp_pass, smtp_host, smtp_ssl | |
bodyParser = require 'body-parser' | |
cloudant = require 'cloudant' account: process.env.cloudant_account, | |
key: process.env.cloudant_key, | |
password: process.env.cloudant_pass | |
email = require 'email' | |
express = require 'express' () |
This file contains 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
app = require('http').createServer(handler) | |
io = require('socket.io').listen(app) | |
fs = require('fs') | |
app.listen 80 | |
handler = () -> | |
fs.readFile __dirname + '/index.html', (err, data) -> | |
if err | |
res.writeHead 500 |
This file contains 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
player = false | |
inGame = false | |
me = undefined | |
dead = undefined | |
gameID = window.location.hash.slice 1 | |
socket = io.connect 'http://localhost' | |
# PLAYER EVENTS | |
kill = (target) -> | |
if inGame and player and not dead then socket.emit 'kill', target |
This file contains 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
style | |
* { | |
box-sizing: border-box; | |
} | |
body { | |
margin: 0 0; | |
padding: 0; | |
background-color: #eee; | |
text-align: center; | |
} |
This file contains 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
!!! | |
html | |
head | |
title Welcome to Farkle | |
link(rel="stylesheet", href="http://getbootstrap.com/dist/css/bootstrap.css") | |
style(type="text/css"). | |
body { | |
margin: 50px auto !important; | |
} | |
label.dice { |
This file contains 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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
// Copyright James Daly 2014 | |
// Compile with: gcc farkle.c -std=c99 -o farkle | |
typedef struct Leader | |
{ | |
char name[16]; |
This file contains 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
Public Class Form1 | |
' Form Controls: Label Label1, Label Label2, TextBox TxtDice, TextBox TxtLimit, CheckBox CbxUntilDone, Button BtnExe, ListBox LstItems, Label LblInfo | |
Public Enum FlipMode | |
FLIP_UNTIL_LIMIT | |
FLIP_UNTIL_MATCH | |
End Enum | |
Private rand As Random | |
Private dice, limit As Integer | |
Private until_limit As FlipMode |
This file contains 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
Public Class Form1 | |
' Form Controls: Label Label1, TextBox TxtCoins, Label Label2, TextBox TxtLimit, CheckBox CbxUntilDone, Button BtnExe, ListBox LstItems, Label LblInfo | |
Public Enum FlipMode | |
FLIP_UNTIL_LIMIT | |
FLIP_UNTIL_MATCH | |
End Enum | |
Private rand As Random | |
Private coins, limit As Integer | |
Private until_limit As FlipMode |
This file contains 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
Module Module1 | |
Private peg0 As Stack(Of Integer) | |
Private limit As UInteger = 5 | |
Private key As ConsoleKeyInfo | |
Private cin, log, output As String | |
Private fileOutput As Boolean = False | |
Private done As Boolean = False | |
Private WithEvents daemon As ComponentModel.BackgroundWorker | |
Sub Main() |
This file contains 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
Public Class Form1 | |
' Form Controls: Button Button1, Button Button2 | |
' ulong input stores user input | |
' ulong output stores result of factorial | |
Private input, output As ULong | |
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click | |
UInteger.TryParse(InputBox("Enter number to find factorial"), input) | |