This file contains hidden or 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 json | |
import fowltek/tmaybe, fowltek/vector_math | |
type | |
TRecordID = int | |
TDataSet* = object ## acts as a counter for the IDs, after data is read, can be used to validate IDs | |
itemCount, projectileCount, vehicleCount: int | |
items: seq[PItemRecord] | |
projectils: seq[int] #pprojectilerecord | |
vehicles: seq[PVehicleRecord] |
This file contains hidden or 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
Single-shot | |
AR 606 - like | |
mines, rockets, grenades | |
multi-shot | |
Shotguns | |
pulsar | |
Healing | |
stim-packs, energizer | |
team heal |
This file contains hidden or 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
proc foo(): int = | |
return(if true: 1 | |
else: 0 ) | |
echo foo() |
This file contains hidden or 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 fowltek/pointer_arithm | |
proc get_shiterator[T] (some: var seq[T]; idx: TSlice[int]): tuple[start,fin: ptr T] = | |
(some[idx.a].addr, some[idx.b].addr) | |
var x = @[1,2,3,4,3,2,1] | |
var (start,fin) = x.get_shiterator(1..5) | |
while start <= fin: |
This file contains hidden or 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
#*************************************************************************** | |
# Copyright (c) 1998-2010,2011 Free Software Foundation, Inc. * | |
# * | |
# Permission is hereby granted, free of charge, to any person obtaining a * | |
# copy of this software and associated documentation files (the * | |
# "Software"), to deal in the Software without restriction, including * | |
# without limitation the rights to use, copy, modify, merge, publish, * | |
# distribute, distribute with modifications, sublicense, and/or sell * | |
# copies of the Software, and to permit persons to whom the Software is * | |
# furnished to do so, subject to the following conditions: * |

This file contains hidden or 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
type | |
TEither[L,R] = object | |
case which: bool | |
of true: left: L | |
else: right: R | |
var x : TEither[string,int] | |
x.right = 42 | |
x.repr.echo |
This file contains hidden or 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
# https://fedorahosted.org/newt/ | |
# http://gnewt.sourceforge.net/index_en.html | |
when defined(LINUX): | |
const DLL_NAME = "libnewt.so" | |
else: | |
{.error: "Newt is not set up for your operating system.".} | |
const | |
NEWT_COLORSET_ROOT* = 2 |
This file contains hidden or 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 fowltek/parsetools/g_parse, fowltek/parsetools/g_lex | |
import strutils | |
const | |
tkCascade = tkComma | |
tkKeyword = tkUser1 | |
tkBlockStart = tkBracketOpen | |
tkBlockEnd = tkBracketClose |
This file contains hidden or 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
{.emit: """ | |
struct Foo { | |
union { | |
int x; | |
float y; | |
}; | |
} Foo; | |
""".} | |
type TFoo {.importc: "struct Foo".} = object |