Skip to content

Instantly share code, notes, and snippets.

View ndugger's full-sized avatar

Nick Dugger ndugger

  • Minneapolis, MN
View GitHub Profile
fn render(condition: bool) -> wjet::Tree {
let bar = false;
wml! {
<Block> {
let foo = false;
let name = "World";
if (!condition) {
<Block { foo: condition, baz: 7 }>
I am the Miaou user with id 1268 and name "nick" on https://miaou.dystroy.org
@ndugger
ndugger / dice.dmx
Last active October 9, 2019 20:49
Dungeon Master
use master number.
define dice as blueprint:
define sides as number.
define new as action (use number as sides):
set dice sides to sides.
define roll as action:
share result of round number (sides: result of random number (min: 0, max: sides)).
use wjet;
pub struct UserInterface {
}
impl UserInterface {
fn new() -> UserInterface {
return UserInterface {
@ndugger
ndugger / _.dmx
Last active October 7, 2019 15:00
Language Comparison: DungeonMaster -> TypeScript
use master dice.
use master game.
use goblin.
define d12 as dice, set to result of new dice (sides: 12).
define mob as goblin, set to result of new goblin (hp: 10, mp: 5).
roll d12.
@ndugger
ndugger / example.ds
Last active August 13, 2019 20:33
Example Ported Script From Papyrus To Dungeon
use list.
use object.
use spell.
define update_equip_state as action (
use actor as self,
use list as armor_list,
use list as cuirass_list,
use list as spell_list
), set to -> nothing:
@ndugger
ndugger / dice.dmx
Last active August 14, 2019 18:38
Dungeon Master Language
use game.
use math.
define dice as blueprint (use number as sides) of game'item, set to:
define roll as action (use number as times, share number), set to:
define value as number, set to 0.
repeat times:
set value to value + do math'round (do math'random (0, sides)).
Me at 9:33 AM
Honestly, though, this should be a huge red flag that you have to jump through a dozen hoops just to properly type redux... It works well, but it's way more complicated than any state management needs to be.
I can write code in C/C++/Rust, I can work with binary data, I can render advanced imagery over Web/OpenGL, but I can't wrap my head around redux spaghetti. No fucking thanks, lol
Someone Else at 10:08 AM
so how would you manage a large redux state?
Me at 10:08 AM
not with redux
If you start to really look at their API, you could write your own store using less code that fits your own needs and is less complicated. Or, you could use a much more sane library like MobX
interface StandardAttributes {
texture: ImageData;
}
interface StandardInputs {
i_Points: Float32Array;
i_Sample: Float32Array;
}
interface StandardUniforms {
import * as Bifrost from 'bifrost';
export default class MainMenu extends Bifrost.GUI.Control {
private handleButtonClick(event: Event): void {
console.log('Button Click:', event);
}
public render(): Bifrost.GUI.Control.Tree {
return [