lt-core/main.lt

39 lines
899 B
Text
Raw Permalink Normal View History

export {
let main = λ{} ↦ {
print-nullterm "Hello World!\n";
2024-05-16 00:47:37 +02:00
/* test ratio
*/
2024-05-16 00:47:37 +02:00
print-nullterm
(fmt-ratio { 4; int-neg 3; })
' ''*'' '
2024-05-16 00:47:37 +02:00
(fmt-ratio { 7; 4; })
' ''='' '
2024-05-16 00:47:37 +02:00
(fmt-ratio (ratio-mul { 4; int-neg 3; } { 7; 4; }))
'\n''\0';
2024-05-16 00:47:37 +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; };
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-16 00:47:37 +02:00
(fmt-vec3i (vec3i-add green-u8rgb blue-u8rgb))
'\n''\0';
uint-machine-to-posint 16 256;
};
2024-05-16 00:47:37 +02:00
}