Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
finding volume of pyramids (for me, but feel free to use)
local r = 5 local b = 11*12 local h = 6 local enable_pi = true -- set true if you want to multiply by pi, set false to use set pi value local pi_value = 3.14 -- set to 0 if you dont want a set value local function cone() if enable_pi or pi_value == 0 then return (1/3)*r^2*math.pi*h else if pi_value == 0 then return (1/3)*r^2*h .."*pi" else return (1/3)*r^2*pi_value*h end end end local function square() return (1/3)*b*b*h end local function triagnle() return 1/3*((1/2)*b)*h end print(cone(), square(), triagnle())
run
|
edit
|
history
|
help
0
Goalless DRAWS
Personal Use (Among Us)
ok
Lua recursion with function
Lua Timer
Exponential from Two Points
The Pyramid in the two-dimensional array made of random stones - Lua
5+5 == 10
Code golf - ASCII art #1
ok