Lister feedback, a new book, Lua, Luarocks, and much more.
`
--[[ GNU All-Permissive License
Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
notice and this notice are preserved. This file is offered as-is,
without any warranty.
https://www.gnu.org/licenses/license-list.en.html ]]--
-- main.lua
vw = 720
vh = 480
function love.load()
-- loads once at launch
love.window.setMode(vw,vh,{resizable=false, vsync=false})
love.window.setTitle('Dice')
math.randomseed(os.time())
computer = math.random(1,20)
player = math.random(1,20)
end
function love.draw()
love.graphics.setColor(255, 255, 255)
if player > computer then
love.graphics.printf("Player wins!",0,vh*0.5,vw*0.5, 'center')
else
love.graphics.printf("Computer wins!",0,vh*0.5,vw*0.5, 'center')
end
end
`
shasum -a256=68437e0263a4f099d134c9753ca702e10ad64b5d57681f2fcafe7f99d2a50033
view more