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
with import <nixpkgs> {}; | |
stdenv.mkDerivation { | |
name = "frobtabs"; | |
src = fetchFromGitHub { | |
owner = "realnc"; | |
repo = "frobtads"; | |
rev = "5850ed918c49873d1c11550d386c2f76e9f37fab"; | |
sha256 = "11l2v184zldaijc89ch5yj29x463xrcwh97s7n68d13f7fbj2a7f"; |
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
#!/usr/bin/env fsharpi | |
#I "../../../.nuget/packages/hopac/0.3.21/lib/net45/" | |
#I "../../../.nuget/packages/hopac.extras/0.3.1/lib/net45" | |
#r "Hopac.Extras" | |
#r "Hopac.Platform" | |
#r "Hopac.Core" | |
#r "Hopac" | |
open System |
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 typetraits | |
import strutils | |
import random | |
import sdl2 | |
import dadren.application | |
import dadren.scenes | |
import dadren.utils |
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
main.nim(8, 3) Error: cannot instantiate 'resize' |
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
method draw(self: VSplit[Color], display: var RendererPtr) = | |
let | |
mp = self.midpointW(self.ratio) | |
top = self.region.top | |
bottom = self.region.bottom | |
display.setDrawColor(255, 255, 255, 255) | |
for y in top..bottom: | |
display.drawPoint(mp, y) | |
self.backward.draw(display) |
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
type Region*[T: int|float] = object | |
left*, top*, right*, bottom*: T | |
proc width*[T](self: Region): T = self.right - self.left | |
proc height*[T](self: Region): T = self.bottom - self.top | |
proc midpointW*[T](self: Region[T], position: float): T = self.left + position * self.width[T]() | |
proc midpointH*[T](self: Region[T], position: float): T = self.top + position * self.height[T]() | |
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 strutils | |
import random | |
import sdl2 | |
import dadren.application | |
import dadren.scenes | |
import dadren.utils | |
template `as` (a, b: untyped): untyped = ((b)a) |
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
type | |
Region*[T: int|float] = object | |
left, top, right, bottom: T | |
# then | |
for node in self.bsp.leaves: | |
var r: Region[float] | |
r.left = node.left | |
r.top = node.top |
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
template `as` (a, b: untyped): untyped = ((b)a) | |
type | |
BSPNode[T] = ref object of RootObj | |
parent: BSPNode[T] | |
ParentNode[T] = ref object of BSPNode[T] | |
forward, backward: BSPNode[T] | |
position: float | |
Leaf[T]= ref object of BSPNode[T] | |
content: T |