Anonymous user
Bitmap/Midpoint circle algorithm: Difference between revisions
m
→{{header|Lua}}: corrected axes
(→{{header|Lua}}: added Lua solution) |
m (→{{header|Lua}}: corrected axes) |
||
Line 1,255:
<lang lua>function Bitmap:axes()
local hw, hh = math.floor(self.width/2), math.floor(self.height/2)
for i =
for i =
self:set(hw,hh,"+")
end
Line 1,275:
bitmap:render()</lang>
{{out}}
<pre>· · · · · · · · · · · ·
· · · · · · · · · ■ ■ ■ ■ ■ ■ ■ · · · · · · · · ·
· · · · · · · ■ ■ · · · | · · · ■ ■ · · · · · · ·
Line 1,287:
· ■ · · ■ · · ■ · · · ■ ■ ■ · · · ■ · · ■ · · ■ ·
· ■ · · ■ · · ■ · · ■ · | · ■ · · ■ · · ■ · · ■ ·
· ■ · · ■ · · ■ · · ■ · | · ■ · · ■ · · ■ · · ■ ·
· ■ · · ■ · · ■ · · · ■ ■ ■ · · · ■ · · ■ · · ■ ·
|