Helehex
Helehex
MModular
Created by Helehex on 8/21/2024 in #community-showcase
Dustbin
I made a little falling sand game today in mojo. https://github.com/helehex/dustbin
68 replies
MModular
Created by Helehex on 8/10/2024 in #community-showcase
Infrared
No description
50 replies
MModular
Created by Helehex on 8/5/2024 in #community-showcase
Thermo
A Physics Engine written in Mojo.
49 replies
MModular
Created by Helehex on 9/20/2023 in #questions
Pass variadic arguments or parameters?
Is there a way to do this currently?
from utils.list import VariadicList

fn func1(*a: Int):
let l: VariadicList[Int] = VariadicList[Int](a)
for i in range(len(l)): print(l[i])

fn func2(*a: Int):
func1(a)

func1(4,5,6,7,1,1)
from utils.list import VariadicList

fn func1(*a: Int):
let l: VariadicList[Int] = VariadicList[Int](a)
for i in range(len(l)): print(l[i])

fn func2(*a: Int):
func1(a)

func1(4,5,6,7,1,1)
2 replies
MModular
Created by Helehex on 9/13/2023 in #questions
how do you disambiguate function calls
also, can you disambiguate between these two:
fn __mul__(self, other: MY_SIMD[type,1]):
// splat multiply
fn __mul__(self, other: MY_SIMD[type,simd_width]):
// flat multiply
...

MY_SIMD[type,1]*MY_SIMD[type,1] // error: ambiguous call to '__mul__'
fn __mul__(self, other: MY_SIMD[type,1]):
// splat multiply
fn __mul__(self, other: MY_SIMD[type,simd_width]):
// flat multiply
...

MY_SIMD[type,1]*MY_SIMD[type,1] // error: ambiguous call to '__mul__'
i can call it splat_mul() instead
8 replies
MModular
Created by Helehex on 9/11/2023 in #questions
Running twice gives error
No description
109 replies