git @ Cat's Eye Technologies Dipple / master lua / frog.lua
master

Tree @master (Download .tar.gz)

frog.lua @masterraw · history · blame

--
-- Frog
--
-- SPDX-FileCopyrightText: Chris Pressey, the original author of this work, has dedicated it to the public domain.
-- For more information, please refer to <https://unlicense.org/>
-- SPDX-License-Identifier: Unlicense
--

local Frog = {}

function Frog:jump(d)
   self.pos = self.pos + d
end

function Frog:report()
   print("at " .. self.pos .. "!")
end

local function new()
   local self = {
      pos = 0,
   }

   setmetatable(self, {__index = Frog})

   return self
end

return { new = new }