Skip to content

Instantly share code, notes, and snippets.

Public Class Form1
' Form Controls: ListBox ListBox1
Private numS As Double = 0
Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
Do
numS += 0.1
ListBox1.Items.Add(numS)
Loop Until numS > 15
Public Class Form1
' Form Controls: TextBox TxtTelephone, TextBox TxtEmail, TextBox TxtPostcode, TextBox TxtHouseNumber, ComboBox CmbTitle, TextBox TxtSurname, TextBox TxtForename, ComboBox CmbRoom, ComboBox CmbAccom, TextBox TxtLength, Button BtnGenBill, Label Label1, Label Label2, Label Label3, Label Label4, Label Label5, Label Label6, Label Label7, Label Label8, Label Label9, Label Label10, Label Label11
#Region "DataClasses"
' Stores items with names and prices, such as room types.
Public Class AccomItem
Public Name As String
Public Price As Single
' Constructor
Public Class Form1
' Form Controls: Label Label1, Label Label2, Button BtnAdd, Button BtnSubtract, Button BtnMultiply, Button BtnDivide, TextBox TxtAns, Button BtnSubmit, Button BtnQuit
' Enum Mode game modes
Public Enum Mode
MODE_ADDITION
MODE_SUBTRACTION
MODE_MULTIPLICATION
MODE_DIVISION
End Enum
Public Class Form1
' Form Controls: Button Btn0, Button Btn1, Button Btn2, Button Btn3, Button Btn4, Button Btn5, Button Btn6, Button Btn7, Button Btn8, Button BtnReset
#Region "PublicVars"
' Array<Integer> board(2) stores the moves made by each player,
' each button corresponding to ascending powers of two
' List<Button> buttons the buttons corresponding to each square on the board
' available the buttons which have not been chosen by either player,
' and are "available for play"
' Array<UInteger> states(9) stores the winning boards
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)
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()
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
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
@jda0
jda0 / farkle.c
Last active June 17, 2016 06:24
Super Awful C to keep scores in a game of Farkle.
#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];
@jda0
jda0 / home.jade
Created January 26, 2014 22:42
Farkle Part 1: Welcome Template (save as index in /home)
!!!
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 {