38 lines
899 B
Text
38 lines
899 B
Text
export {
|
||
let main = λ{} ↦ {
|
||
print-nullterm "Hello World!\n";
|
||
|
||
/* test ratio
|
||
*/
|
||
print-nullterm
|
||
(fmt-ratio { 4; int-neg 3; })
|
||
' ''*'' '
|
||
(fmt-ratio { 7; 4; })
|
||
' ''='' '
|
||
(fmt-ratio (ratio-mul { 4; int-neg 3; } { 7; 4; }))
|
||
'\n''\0';
|
||
|
||
/* Colors
|
||
*/
|
||
let red-u8rgb
|
||
: <Fn <> Color ~ RGB ~ <Vec3 ℝ_0,1 ~ ℤ_256 ~ machine.UInt64>>
|
||
= λ{} ↦ { 0; 0; 255; };
|
||
|
||
let green-u8rgb = λ{} ↦ { 0; 255; 0; };
|
||
let blue-u8rgb = λ{} ↦ { 255; 0; 0; };
|
||
let yellow-u8rgb = λ{} ↦ { 0; 220; 220; };
|
||
|
||
print-nullterm (fmt-vec3i (morph-rgb-to-hsv yellow-u8rgb)) '\n''\0';
|
||
|
||
print-nullterm
|
||
(fmt-vec3i green-u8rgb)
|
||
' ''+'' '
|
||
(fmt-vec3i blue-u8rgb)
|
||
' ''='' '
|
||
(fmt-vec3i (vec3i-add green-u8rgb blue-u8rgb))
|
||
'\n''\0';
|
||
|
||
uint-machine-to-posint 16 256;
|
||
};
|
||
}
|
||
|