2024-09-29 22:20:10 +02:00
|
|
|
|
export {
|
|
|
|
|
let main = λ{} ↦ {
|
|
|
|
|
print-nullterm "Hello World!\n";
|
2024-05-16 00:47:37 +02:00
|
|
|
|
|
2024-05-18 18:01:41 +02:00
|
|
|
|
/* test ratio
|
|
|
|
|
*/
|
2024-05-16 00:47:37 +02:00
|
|
|
|
print-nullterm
|
2024-05-18 18:01:41 +02:00
|
|
|
|
(fmt-ratio { 4; int-neg 3; })
|
|
|
|
|
' ''*'' '
|
2024-05-16 00:47:37 +02:00
|
|
|
|
(fmt-ratio { 7; 4; })
|
2024-05-18 18:01:41 +02:00
|
|
|
|
' ''='' '
|
2024-05-16 00:47:37 +02:00
|
|
|
|
(fmt-ratio (ratio-mul { 4; int-neg 3; } { 7; 4; }))
|
2024-05-18 18:01:41 +02:00
|
|
|
|
'\n''\0';
|
2024-05-16 00:47:37 +02:00
|
|
|
|
|
2024-05-18 18:01:41 +02:00
|
|
|
|
/* Colors
|
|
|
|
|
*/
|
2024-05-16 00:47:37 +02:00
|
|
|
|
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; };
|
|
|
|
|
|
2024-05-18 18:01:41 +02:00
|
|
|
|
print-nullterm (fmt-vec3i (morph-rgb-to-hsv yellow-u8rgb)) '\n''\0';
|
|
|
|
|
|
|
|
|
|
print-nullterm
|
|
|
|
|
(fmt-vec3i green-u8rgb)
|
|
|
|
|
' ''+'' '
|
2024-06-11 15:17:58 +02:00
|
|
|
|
(fmt-vec3i blue-u8rgb)
|
2024-05-18 18:01:41 +02:00
|
|
|
|
' ''='' '
|
2024-05-16 00:47:37 +02:00
|
|
|
|
(fmt-vec3i (vec3i-add green-u8rgb blue-u8rgb))
|
2024-05-18 18:01:41 +02:00
|
|
|
|
'\n''\0';
|
|
|
|
|
|
|
|
|
|
uint-machine-to-posint 16 256;
|
2024-09-29 22:20:10 +02:00
|
|
|
|
};
|
2024-05-16 00:47:37 +02:00
|
|
|
|
}
|
|
|
|
|
|