Update 'mid'

2021-12-07 17:47:54 +01:00
parent 957b89e49d
commit 7b9220db00

17
mid.md

@@ -13,23 +13,14 @@ L'ultim valor a comparar.
### Exemple
```
function init()
setmode(2)
x,y=10,7
color(COLOR_YELLOW, COLOR_BLUE)
setmode(1)
end
function update()
cls()
if btn(KEY_UP) then
y = max(0, y-1)
elseif btn(KEY_DOWN) then
y = min(y+1, 14)
end
if btn(KEY_LEFT) then
x = max(0, x-1)
elseif btn(KEY_RIGHT) then
x = min(x+1, 19)
end
local x = mid(0,mousex(),39)
local y = mid(0,mousey(),29)
print(x..","..y, 0, 0)
print("\224",x,y)
end
```