Skip to content

Instantly share code, notes, and snippets.

using System;
namespace ConsoleAppTest01
{
class Program
{
static readonly Random RNG = new Random();
enum Choice
{
import random
print("Let's play some Rock, Paper, Scissors!")
options = ['rock', 'paper', 'scissors']
trumps = {'rock': ['scissors'], 'paper': ['rock'], 'scissors': ['paper']}
wins = 0
losses = 0
running = True
const int pulsePin = 13;
const int pulseLength = 10; // Pulse time in milliseconds
const int pulseDelay = 10; // Delay between pulses
void setup() {
pinMode(pulsePin, OUTPUT);
}
void loop() {
digitalWrite(pulsePin, 1);
@DivinityArcane
DivinityArcane / strtok.c
Created October 29, 2014 08:35
because strtok was being evil
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int stroccurs (const char* src, const char delim) {
int occurances = 0;
char c;
while ((c = *src++)) {
if (c == delim)
// / temp.ino
// ? Simple temperature reader. Reads temperature via LM335Z sensor and outputs to SMC1602A compliant LCD
// @ Justin Eittreim <eittreim.justin@live.com>
#include <LiquidCrystal.h>
// Provide the appropriate pins to the LCD library
// 12=RS, 11=E, 5=D4, 4=D5, 3=D6, 2=D7
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
#include <stdio.h>
#include <stdlib.h>
typedef unsigned char byte;
typedef char* string;
string dec2bin(byte x)
{
int i;
string bin = (string)malloc(sizeof(char)*9);
@DivinityArcane
DivinityArcane / mangapanda.php
Created October 7, 2014 23:20
Simple scraper for MangaPanda.com
<?php
// MangaPanda.com Scraper
// Downloads manga to be read locally, and organizes the files.
/// !!! It goes without saying, but if you don't own a physical copy of the manga, downloading it is illegal!
/// @ Justin Eittreim <eittreim.justin@live.com>
$name = "ao-haru-ride"; // Name portion of the URL.
$prettyname = "Ao Haru Ride"; // Proper name, for the folder.
$first_chapter = 16; // First chapter to scrape.
#include <stdio.h>
#include <stdlib.h>
int main (int argc, char** argv) {
int num = 0;
char buf[12];
puts("Enter a number: ");
fgets(buf, 12, stdin);
num = atoi(buf);
printf("The number you entered was: %i\n", num);
package network
import (
"net"
"io"
"time"
"bufio"
)
// It's simpler to use a bufio.Reader, instead of dealing with
package network
import (
"strings"
)
type Packet struct {
Command, Parameter, Body string
Arguments map[string]string
SubPacket *Packet