lt-core/main.lt
2024-06-11 15:17:58 +02:00

36 lines
895 B
Text
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{
print-nullterm 'H''e''l''l''o'' ''W''o''r''l''d''!''\n''\0';
/* 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;
}