The date()
function returns a formatted date.
It takes three arguments
- format, the format to use for display (See: Programming in Lua 22.1 - Date and Time). Starting the format with
!
makes it UTC, otherwise it will be local time. - t, the timestamp either as a string (in the default UTC
YYYY-mm-dd HH:MM:SS
) or Unix timestamp (seconds since 1970-01-01 00:00:00) - delta, an amount of seconds to add to the timestamp.
date()
gets the current time in UTC, and is used to generate timestamps in Picotron (for modified and created times).
date("%Y-%m-%d %H:%M:%S", timestamp)
converts timestamp
to local time. (So you can store timestamps in UTC and later display them in local time)
date(nil, nil, -86400 * 10)
subtracts 10 days from the current time.
Since timestamps are in YYYY-mm-dd HH:MM:SS
format, they can be compared directly as strings.
Made for the Trijam #304 - 1 Button Adventure in a little bit over of 3 and a half hours.
Use your randomly assigned movepool to defeat the enemy!
Basic Moves:
Attack - Deal 10 + Strength damage - Diamond Icon
Shield - Gain 10 Shield - Shield Icon
Heal - Gain 10 health - Heart Icon
Status moves:
Bite - Deal 5 + strength damage. Chance to inflict 1 Poision - Skull icon. Poision ticks periodically, hits hp directly.
Mock - Deal 5 + strength damage. Chance to inflict 1 Burn - Orange Yelpi icon. Flame hits periodically, hits shield first.
Slap - Deal 5 + strength damage. Chance to inflict 1 Confusion - Fist icon
Empower moves:
Taunt - Gain 2 shield. Gain 1 strength. - Blue Face icon.
Evade - Gain 2 shield. Gain 1 evasion. - Fog Icon. Evasion gives dodge chance.
Aim - Gain 2 shield. Gain 1 accuracy - Eye Icon. Chance to hit through evasion, and crit.
Healing moves:
Cleanse: Heal for 5. Cleanse 1 negative debuff - Green cross
Pray: Heal for 5, grants strength. - Blue Hands
Fatigue:
If the match goes long enough and incrementing fatigue starts to hit both combatants.
Support:
My awesome supporters over at
Sun Queen
This is a game where you guide a dog around a park to soak up the sun wherever it appears and eat some bananas. It's dedicated to our Yorkie Silky dog named Daisy Mae, who passed away at the age of 14. Her favorite things in the world were - wait for it - sunshine and bananas.
How to play
Use the d-pad/arrow keys to move Daisy around. Try to stay within the sun spots as they grow and shrink for as long as possible to gain points before the timer runs out. Eating the bananas is optional but will get you 10 points.
Thanks for playing!
This is a version of Conway's Game of Life with PVP support! It's inspired by/based on this DougDoug stream: A Crew VS. Z Crew in Conway's Game of Life.
The rules are very similar to regular Conway's Game of Life.
- Any living cell with < 2 living neighbors dies (underpopulation)
- Any living cell with 2 or 3 living neighbors lives
- Any living cell with > 3 living neighbors dies (overpopulation)
- Any dead cell with exactly 3 live neighbors lives (reproduction)
However, there are two colors, red and blue. For rules (2) and (4), when the cell lives, it will match the color of its adjacent cells. If there are more red adjacent cells, it will become red. If there are more blue adjacent cells, it will become blue. If there are an equal number of red and blue adjacent cells, it will randomly choose one.
While creating a program that uses Lua tables, I found it troublesome to check values, so I created this.
It is convenient to save it with a name such as dprt.lua and use it by including it.
--If you no longer need the debug display, you can disable it all together --by changing DEBUG_FLG to false. --Also, if you want to display it on the host, set DEBUG_TO_HOST to true DEBUG_FLG = true DEBUG_TO_HOST = true function dprt(v) local function dbg(v) local buf, t, i = "", type(v), 0 if t == "table" then buf = "table{" for i in pairs(v) do if v[i] != nil then buf = string.format("%s \n\t%s: %s", buf, i,dbg(v[i])) end end buf = string.format("%s \n},", buf) elseif t == "userdata" then buf = "userdata{" for i=0,#v-1 do buf = string.format("%s %s: %s", buf, i, dbg(v[i])) end buf = string.format("%s \n},", buf) elseif t == "number" then [ [size=16][color=#ffaabb] [ Continue Reading.. ] [/color][/size] ](/bbs/?pid=160665#p) |
- item 1
Inicializar o tabuleiro vazio (8x8)
tabuleiro = criar_tabuleiro(8, 8)
Gerar as primeiras 3 peças
pecas = gerar_pecas_iniciais()
Variáveis de controle
pontuacao = 0
fim_do_jogo = False
- item 2
def criartabuleiro(linhas, colunas):
return [[' ' for in range(colunas)] for _ in range(linhas)]
def exibir_tabuleiro(tabuleiro):
colunas = 'ABCDEFGH'
for i, linha in enumerate(tabuleiro):
print(f"{colunas[i]} " + " ".join(linha))
print()
-
item 3
def gerar_pecas_iniciais():
pecas_possiveis = [
[(0, 0), (0, 1), (0, 2)], # Linha reta
[(0, 0), (1, 0), (2, 0)], # Linha reta vertical
[(0, 0), (1, 0), (1, 1)], # L
[(0, 0), (0, 1), (1, 1)] # T
]
return [random.choice(pecaspossiveis) for in range(3)] - item 4
def posicionar_peca(tabuleiro, peca, linha, coluna):
if not verificar_espaco(tabuleiro, peca, linha, coluna):
- item 1
Inicializar o tabuleiro vazio (8x8)
tabuleiro = criar_tabuleiro(8, 8)
Gerar as primeiras 3 peças
pecas = gerar_pecas_iniciais()
Variáveis de controle
pontuacao = 0
fim_do_jogo = False
-
item 2
def criartabuleiro(linhas, colunas):
return [[' ' for in range(colunas)] for _ in range(linhas)] -
item 3
def gerar_pecas_iniciais():Definir os formatos das peças (por exemplo, L, T, quadrado, linha)
pecas_possiveis = [
[(0, 0), (0, 1), (0, 2)], # Linha reta
[(0, 0), (1, 0), (2, 0)], # Linha reta vertical
[(0, 0), (1, 0), (1, 1)], # L
[(0, 0), (0, 1), (1, 1)] # T
]
return [random.choice(pecaspossiveis) for in range(3)] - item 4
def posicionar_peca(tabuleiro, peca, linha, coluna):
for (dx, dy) in peca:
if tabuleiro[linha + dx][coluna + dy] != ' ':
return False # A peça não pode ser colocada aqui (colisão)
Side Quest 2 is broken down into 4 requests from the same villager. You first come across this Side Quest in "Lesson 6: Print to the Screen" and are encouraged to revisit it after learning how to use variables in "Lesson 7: Variables & Data Types". You are free to submit both examples under this post, but you should make it clear whether you made them with or without variables.
2-1
"Hi, I have a clothing store and I need a sign that shows people our fabric color options. Can you print the numbers 1 through 15 but in those exact colors for me?"
2-2
"I also do custom jobs where I can design someone's name into the fabric. Can you give me some ideas by printing your name, one letter at a time, in a really cool pattern?"
Hello everyone,
Here's my first upload to the BBS ever, it's a simple rewrite of the ls.lua
util. I've always preferred using ls -al
(that is usually aliased as ll
) in my unix terminals and because the muscle memory is too strong, I've just remade it quickly in Picotron.
Let me know if you have any issue. I also wanted to add the 'rwx' info just as a joke, but it crowded the output a bit too much.
Just copy this code in 'll.lua' in '/appdata/system/util'
function lpad(nb, str) local nb_to_add = nb - #str local result = "" for k=0,nb_to_add do result = result.." " end return result..str end cd(env().path) local path0 = env().argv[1] or "." path = fullpath(path0) if (not path) then print("could not resolve path "..tostr(path0)) exit(0) end local res=ls(path) if (not res) then print("could not find path "..tostr(res)) exit(0) end [ [size=16][color=#ffaabb] [ Continue Reading.. ] [/color][/size] ](/bbs/?pid=160609#p) |
I'm trying to do a simple state machine but I'm doing something wrong in the assign.
I wanna assign "running" if a button is pushed from a list of values.
player = { lives = 3, current_state, list_states = {"running","jumping","falling"} } function _update() if btnp(❎) then player.current_state = player.list_states["running"] end end function _draw() cls(1) print(player.current_state) end |
This doesn't work:
player.current_state = player.list_states["running"]
This works but its not very useful because I don't see in the code which state I'm assigning:
player.current_state = player.list_states[1]
This also works, but I think it's also not very useful because the usefulness of the state machine is assigning a concrete value from a set of predefined values to avoid mistakes.
player.current_state = "running"
How can i do it? Or whats the usual approach to make states machines?
Thank you!
Prehistoric Cantine - A 2 player coop game.
This is prehistory.
After school, the children play by the river and then go to eat in the school canteen. It's up to you to keep an eye on them and then take them to the school canteen.
Do everything you can to make sure kids don't fall into the water, bump into walls, or get swept away by dinosaurs.
When the bell rings, bring ALL the kids to the school canteen to take it to the next level!
Play with one controller per person or one keyboard for two.
--
French version is here :
About
- Try to go the furthest distance!
- Collect coins to brighten the cave!
Controls
- Press any button on keyboard, gamepad or mouse to jump.
- Press enter or start to pause.
Credit
- Made by: MrDuckyWucky
- Uploaded: Jan 12, 2024
- Also on itch.io
[CAT]
Hola a tots! He fet una petita utilitat per poder mostrar per pantalla els caràcters especials del català a Picotron. En concret afegeix suport per als caràcters:
ÀÈÉÍÓÒÚ àèéíòóú ÏÜ ïü Çç l·l
Sou lliures de modificar-la si voleu. Aquest cartutx és un exemple d'ús. Només cal:
1-Importar la llibreria al vostre cartutx
2-Importar-la al codi (com a l'exemple)
3-Ja podeu utilitzar les funcions de la llibreria. Són dues: bcursor(x,y) i bprint(text, [x], [y], [color])