Take N as an argument, then compile an executable named square_of_<N> that prints the square of N
local stdio = terralib.includec("stdio.h")
local function squarer(n)
return terra()
stdio.printf("%i\n", n * n)
end
end
local n = tonumber(... or 0)
terralib.saveobj("square_of_"..tostring(n), { main = squarer(n) })
Bash
Using
curl
to make a request to some API I found on googleTerra
Take N as an argument, then compile an executable named
square_of_<N>
that prints the square of NI laughed at the curl solution I'm not gonna lie