From a0950797e39b0acca0a883dea8f9621750ca6eb6 Mon Sep 17 00:00:00 2001 From: Emik Date: Fri, 13 Feb 2026 22:42:12 +0100 Subject: [PATCH] Use terse syntax --- src/back.lua | 5 +---- src/joker.lua | 18 ++++-------------- 2 files changed, 5 insertions(+), 18 deletions(-) diff --git a/src/back.lua b/src/back.lua index 880e7ab..c642f3c 100644 --- a/src/back.lua +++ b/src/back.lua @@ -1,10 +1,7 @@ local f, q = unpack(... or require "src.functional") local function save(ret) - q(function() - save_run() - end) - + q(save_run) return ret end diff --git a/src/joker.lua b/src/joker.lua index bbf5a9c..04d1b5a 100644 --- a/src/joker.lua +++ b/src/joker.lua @@ -124,11 +124,7 @@ joker { } end, calculate = function(_, _, context) - if type(G.escapey_debugger) == "function" then - G.escapey_debugger(f(context):reduce("", function(acc, _, next) - return acc .. ", " .. next - end):sub(2)) - end + local _ = type(G.escapey_debugger) == "function" and G.escapey_debugger(f(context):keys():conjoin(", ")) end, Bakery_can_use = function(_, card) return not card.debuff and u() and ( @@ -214,9 +210,7 @@ joker { end) end - local hands = f(G.GAME.hands):filter(function(v, _) - return v.visible - end):keys():into() + local hands = f(G.GAME.hands):filter(f "visible"):keys():into() pseudoshuffle(hands, pseudoseed "RolandEscapey") local levels = destroyed * card.ability.extra.hands @@ -379,10 +373,7 @@ joker { card.getting_sliced = true q(function() - local scored_cards = f(G.play.cards):filter(function(v) - return v.highlighted - end):into() - + local scored_cards = f(G.play.cards):filter(f "highlighted"):into() local copied = {} for _ = 1, extra.times do @@ -442,8 +433,7 @@ joker { } end, calculate = function(_, _, context) - local _ = context.selling_self and - draw_card(G.deck, G.hand, 100, "up", false, G.deck.cards[1]) + local _ = context.selling_self and draw_card(G.deck, G.hand, 100, "up", false, G.deck.cards[1]) end, }