Skip to content

Instantly share code, notes, and snippets.

View fowlmouth's full-sized avatar
🦃

Tim E fowlmouth

🦃
  • United States of America
View GitHub Profile
iterator countfrom (start, fin: int, step = 1): int =
if start < fin:
for i in countup(start, fin, step):
yield i
else:
for i in countdown(start, fin, step):
yield i
for x in countfrom(10,1):
import unittest
suite "test":
setup:
var i = 42
test "i is 42":
check:
i == 42
when defined(LINUX):
const libName* = "libjit.so"
type
PContext* = ptr object
PFunction* = ptr object
PBlock* = ptr object
PInstruction* = ptr object
PValue* = ptr object
PType* = ptr object
*
* STFL - The Structured Terminal Forms Language/Library
* Copyright (C) 2006 Clifford Wolf <[email protected]>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
import unittest
suite "numbers":
setup:
#this code is run before each test
var x = 1
test "1 + 1 == 2":
#do stuff in here
check 1 + 1 == 2
import enet, strutils, streams,
private/pkt_tools
if enetInit() != 0:
quit "Could not initialize ENet"
var client: PHost = createHost(nil, 1,2,0,0)
if client.isNil:
quit "Could not create client"
import
enet,
endians,
unsigned
export unsigned, endians
type TScalar* = int8 | uint8 | byte | char | bool |
int16| uint16| int32|uint32|
float32|float64|int64|uint64
#include "stdio.h"
#include <stdlib.h>
typedef void (*cleanup_function) (void*);
// the interface
struct IPoint {
float *x, *y;
cleanup_function cleanup;
type
parbiter = object
swappedcoll: bool
a,b: pshape
pshape = ptr object
#/ Return the colliding shapes involved for this arbiter.
#/ The order of their cpSpace.collision_type values will match
#/ the order set when the collision handler was registered.
import signals, strutils
echo "\L--- GC TEST ---"
var displayUpdate = initSignal[void]()
type
GCO = ref object of TObject
id : int