This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
|= raw=tape | |
^- tape | |
=< ?:((valid raw) (turn raw convert) "input contains non-rune characters") | |
|% | |
++ valid | |
|= x=tape | |
^- ? | |
=/ chars (sy x) | |
(~(all in chars) |=(c=@t (~(has by table) c))) | |
++ convert |
|= dim=@ud ^- (list @t) | |
=/ dx (div:rs .1 (sun:rs dim)) | |
=/ white [.1 .1 .1] | |
=< (genppm dim) | |
|% | |
++ min | |
|= [x=@rs y=@rs] ^- @rs | |
?: (lth:rs x y) x y | |
++ max | |
|= [x=@rs y=@rs] ^- @rs |
// Usage - with library support for joint allocation, usage might look something like this: | |
struct Vector3 { | |
float x, y, z; | |
}; | |
struct Mesh { | |
private: | |
JointPool pool; |
#include <vector> | |
using namespace std; | |
struct Vector3 { float x, y, z; }; | |
struct Mesh { | |
vector<Vector3> positions; | |
vector<int> indices; | |
}; |
This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer