I golfed a function to check the winner of a tic-tac-toe board down to 116 characters of Lua 5.3. The input board is represented as a table of 9 ternary digits and the winner or nil is returned.
function f(t)x,y=33231141,7 for i=1,8 do v=t[y]b=x%10 if 1/v==v/t[y+b]/t[y+b+b]then return v end y=b x=x//10 end end
Yep! Roact generally doesn’t help too much with this kinda stuff though, however it makes UI development a lot more bearable (component isolation and reuse). I’m using Otter for the animations, and ViewportFrames for the clipping.
Interesting use of ViewportFrames: have you placed cylinders plastered with decals of Rōblox avatars into those frames? I might potentially incorporate Roact and/or Rodux into a future project, though wouldn’t it drastically increase the file size?
I’ve once attempted to write a program in Java that parses the entire XML time zone manifest for Windows. It was quite a few kilo/megabyes big, and contained and requited extensive mathematical calculations.