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
#!/bin/sh | |
# WARNING: It'll DELETE files called "compressed" "decompressed" "ref_compressed" if that's important | |
# This tests all files in input_files directory. Place in pa2 project root folder. | |
# It's pretty janky, it will output the diff if there's something wrong | |
# It'll discard all output by compress, uncompress, and ref_compress | |
# It also prints out the file sizes so you can check your file size against ref compress | |
# Code is pretty straight foward, should def read before using. Use at your own risk. |
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
import React, { Component } from 'react'; | |
import {TextInput, TouchableWithoutFeedback, StyleSheet} from 'react-native'; | |
const Platform = require('Platform'); | |
const requireNativeComponent = require('requireNativeComponent'); | |
const emptyFunction = require('fbjs/lib/emptyFunction'); | |
if (Platform.OS === 'android') { | |
var AndroidTextInput = requireNativeComponent('AndroidTextInput', null); | |
} else if (Platform.OS === 'ios') { | |
var RCTTextView = requireNativeComponent('RCTTextView', null); |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Isle of man tt | |
Amusement park | |
Roller coaster | |
Granny smith | |
Air show | |
Reflex camera | |
Membranophone | |
String instrument | |
Wind instrument | |
Gourd |
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
const express = require('express'); | |
const socketio = require('socket.io'); | |
const http = require('http'); | |
const app = express(); | |
const server = http.Server(app); | |
const io = socketio(server); // Attach socket.io to our server | |
app.use(express.static('public')); // Serve our static assets from /public |
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
<div id="player-one"> | |
<div class="game-container"> | |
<div class="game-message"> | |
<p></p> | |
<div class="lower"> | |
<a class="keep-playing-button">Keep going</a> | |
<a class="retry-button">Try again</a> | |
</div> | |
</div> | |
<div class="grid-container"> |
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
const connections = [null, null]; | |
// Handle a socket connection request from web client | |
io.on('connection', function (socket) { | |
// Find an available player number | |
let playerIndex = -1; | |
for (var i in connections) { | |
if (connections[i] === null) { | |
playerIndex = i; |
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
socket.on('actuate', function (data) { | |
const { grid, metadata } = data; // Get grid and metadata properties from client | |
const move = { | |
playerIndex, | |
grid, | |
metadata, | |
}; | |
// Emit the move to all other clients |
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
socket.on('actuate', function (data) { | |
const { grid, metadata } = data; // Get grid and metadata properties from client | |
const move = { | |
playerIndex, | |
grid, | |
metadata, | |
}; | |
// Emit the move to all other clients |
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
socket.on('actuate', function (data) { | |
const { grid, metadata } = data; // Get grid and metadata properties from client | |
const move = { | |
playerIndex, | |
grid, | |
metadata, | |
}; | |
// Emit the move to all other clients |
OlderNewer