#programming
1 messages · Page 195 of 1
shirpo do you want hblang bindings 
token counter does need a fix
last updated 4 years ago
trying to update any of the dependencies is hell tho
tried
(gdb) bt
#0 __syscall_cancel_arch () at ../sysdeps/unix/sysv/linux/x86_64/syscall_cancel.S:56
#1 0x000079721bca00ec in __internal_syscall_cancel (a1=a1@entry=105616026212552, a2=<optimized out>, a3=a3@entry=0, a4=a4@entry=0, a5=a5@entry=0, a6=a6@entry=4294967295, nr=202) at ./nptl/cancellation.c:49
#2 0x000079721bca0847 in __futex_abstimed_wait_common64 (private=<optimized out>, futex_word=0x600ea5b998c8, expected=0, op=<optimized out>, abstime=0x0, cancel=true) at ./nptl/futex-internal.c:57
#3 __futex_abstimed_wait_common (futex_word=0x600ea5b998c8, expected=0, clockid=0, abstime=0x0, private=<optimized out>, cancel=true) at ./nptl/futex-internal.c:87
#4 __GI___futex_abstimed_wait_cancelable64 (futex_word=futex_word@entry=0x600ea5b998c8, expected=expected@entry=0, clockid=clockid@entry=0, abstime=abstime@entry=0x0, private=<optimized out>) at ./nptl/futex-internal.c:139
#5 0x000079721bcac5ff in do_futex_wait (sem=sem@entry=0x600ea5b998c8, abstime=0x0, clockid=0) at ./nptl/sem_waitcommon.c:111
#6 0x000079721bcac698 in __new_sem_wait_slow64 (sem=0x600ea5b998c8, abstime=0x0, clockid=0) at ./nptl/sem_waitcommon.c:183
#7 0x0000600e713cd878 in start_chess_api () at /home/owobred/neuro/other/chess-tournament/target/debug/build/chess-api-8324e014b9d4855d/out/chessapi.c:1544
#8 0x0000600e713cdaa3 in chess_get_board () at /home/owobred/neuro/other/chess-tournament/target/debug/build/chess-api-8324e014b9d4855d/out/chessapi.c:1601
#9 0x0000600e713867e7 in chess_api::Board::get () at chess-api/src/lib.rs:285
#10 0x0000600e71386068 in chess_bot::main () at chess-bot/src/main.rs:7
200iq, I debugged it after it stalled
Nothing ever happens, all-in
@real sierra rust bindings have been thrown into https://github.com/owobred/chess-competition-rust-bindings
unless I have a major skill issue you should just need to run cargo run in the root directory and the bot will be ran

(or well, not ran)
beware rust people, I have never made bindings before
so it will be scuffed
hm?
no repr C?
(keep in mind I'm currently bringing in my own copy of the api because I am too lazy to fetch it from shrios repo)

wait I might be stupid on that front
ye leaked the bindings 
ye those aren't the ones that go through ffi

c supposed to be private still

shiro use more macros 
smh
just like
don't sleep all night so you don't remember
macros

shimo bitboard.c could be 30% of the size if you use macro

you havent seen this
theres like so many ifs with just this
too late already cloned, backed up on 30 bulletproof HDDs on-site, on 30 tape spools off-site and uploaded onto 3 high orbit satellites
shrio can you just prematurely execute me

binding

nyamacros
part of me wants these to be macros too but it doesnt do anything 

ye my chess bot now

konii about the back up the entire chess bot api in screenshots before shiro wakes up
honestly why even have that
Board* is a singleton
so it shouldnt be passed via function arguments at all
functions should just access the global Board* by themselves
hiro can use that function internally if he wants to
the thing that confuses me is you can free the board
ye ye but
imo it makes sense if you read the comments
the api global
but also yeah its odd
its ok its just a beta api 
can't wait for apple ai slop on the iphone
so are they working?
ok so fwiw shiro, my threads are stuck on these lines https://pastes.dev/uvwp3eRU3L

don't forget there are two models promised, a small one for local and large on cloud

that shouldnt be possible
i wish shiro
ok guest additions finally installed on vm
now i can copy paste from it to here

but also wtf has it done to my res
480p screen
iirc it means you can resize the window
or something
instead of having to manually change res
feel free to test whether or not it breaks for you in the vm
pls

macro not dangerous macro your friend
marco
shiro cant use macro used to java 
macro is a micronutrient
working ugly better than pretty broken

its easier to bugfix deduplicated code


idk if anyone can help, but I‘ve been trying to tokenize a tfds dataset recently but the tokenization functions from tfds and tf dont seem to be available? did they get removed in a later version or smth? anyone knows?
can i get a call trace here
or
why are you nerds such nerds
me not nerd
huh?
gotta make a living somehow yk?
oh it is
i didnt realize
i have concluded this makes no sense
the mutex is blocking despite it being the first time it hits it

mal (mirw) (mweow) (cat enthusiast)
who locked my mutex 
sory 
not cat myself

this my domain
fwiw shiro I'm just sending ```
uci
isready
ucinewgame
position startpos moves f2f4
go wtime 300000 btime 300000 winc 0 binc 0



hi konii
@trim valve pushed new
hi shibo
hi scrub
how long is the tourney gonna run for

a month is the plan
shiro how are your commits this wrong 
your commit message says you added a function to the chess api
but it doesn't actually show up until 3 commits later
i didnt look at my file explorer right
i just pushed chessapi.c
but it was the old copy sitting in the python directory
can I criticize your commit messages
it would be nice if C changes were C: <message> and the python changes were Py: <message>
this isnt the terminal
?
the C and python files are totally disjoint
thats my point


prefix the commit message to make it easier to tell what a commit is modifying

bred officially the first person to make a chess bot other than me
will try to do in future
im experimenting with doxygen rn but realizing it might not support every language
i dont wanna use it for only half the docs
idk it supports C, C++, and C# and thats all you really need

cant keep getting away
we will catch

hows your C# impl going btw
uh I had class this morning
semi important change for you, a chess_free_moves_array func was added
so you dont need to import libc for free anymore
ee gonna steal your code lines

unless you're fine with manually compiling the C dll before compiling the C# library
doxygen default config has helpful comments
almost too many
thing is 3000 lines with the comments
@real sierra
what mean
id rather people dont need to download a dll
the C# impl needs to link against the C dll
doesnt sound very portable
2025-09-15 23:33:30.732<--1:thread 'main' (109966) panicked at chess-api/src/lib.rs:364:18:
2025-09-15 23:33:30.732<--1:unsafe precondition(s) violated: slice::from_raw_parts requires the pointer to be aligned and non-null, and the total size of the slice not to exceed `isize::MAX`
2025-09-15 23:33:30.733<--1:This indicates a bug in the program. This Undefined Behavior check is optional, and cannot be relied on for safety.
2025-09-15 23:33:30.733<--1:note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
2025-09-15 23:33:30.733<--1:BytesRead > 0
2025-09-15 23:33:30.733<--1:n > 0
2025-09-15 23:33:30.733<--1:-- LiesThread.Execute terminated --
2025-09-15 23:33:30.733<--1:thread caused non-unwinding panic. aborting.
I may
have a bug
also unrelated but ```
2025-09-15 23:38:52.9791Start calc, move no: 200
2025-09-15 23:38:52.980-->1:position startpos moves e2e4 a7a5 g2g3 g8f6 f1b5 c7c5 h2h4 h8g8 b5a6 g7g6 d1h5 g8h8 h5d5 b7a6 d5c6 a8a7 g1e2 a7c7 e1f1 a5a4 f1e1 h7h6 h1h2 c7c6 d2d3 h8g8 g3g4 d8a5 e2c3 c6e6 e1f1 f8g7 b1d2 c8b7 b2b4 a5b5 c3e2 f6e4 c1a3 g8f8 a1c1 e4f6 e2f4 b5c6 f4e6 c6h1 f1e2 f6g8 h2h1 f7f5 e6c7 e8f7 c1f1 d7d6 d2b3 b7e4 f1a1 e4f3 e2f1 g7f6 c7e6 f3h1 b4b5 c5c4 g4f5 h1e4 e6f4 e4h1 a3b2 a4b3 b2f6 b3b2 f4g6 b2a1q f1e2 d6d5 f2f3 a1e1 e2e1 e7e5 f3f4 h1g2 f6e7 h6h5 e7f8 a6b5 e1d1 g2e4 f8g7 f7e8 c2c3 e8d8 d1c1 d5d4 a2a3 e5f4 c1d2 d8c7 g7d4 e4f5 d4f6 b8c6 f6d4 c6e5 d4a7 f5c8 d2e2 c8g4 e2d2 c7c8 g6e5 c8d8 a7b8 g8h6 e5d7 d8d7 b8e5 h6f7 d2c1 f7h8 c1d2 b5b4 d2e1 f4f3 e1d1 b4a3 e5h8 d7c8 h8d4 c4d3 d4b6 c8b8 b6c5 g4h3 c5b6 h3c8 c3c4 c8f5 c4c5 b8c8 c5c6 f5g4 b6a5 a3a2 c6c7 a2a1n d1e1 g4f5 a5d2 a1c2 e1f1 c2a1 f1e1 f5h7 d2c3 h7g8 c3d2 a1c2 e1d1 c2e1 d1c1 c8d7 c7c8r d7d6 c8b8 d6e7 d2c3 g8a2 c3d2 a2c4 b8b7 e7e8 c1d1 c4b5 d2g5 b5a6 b7b6 f3f2 g5e7 f2f1b d1c1 d3d2 c1d2 a6d3 d2c1 e8e7 b6b4 f1h3 b4e4 e7d7 e4e5 d7c8 c1d1 e1c2 e5e3 h3e6 e3d3 c2a3 d3b3 e6g4
2025-09-15 23:38:52.980-->1:go wtime 300000 btime 300000 winc 0 binc 0
2025-09-15 23:38:52.981<--1:BoardMoves::as_slice {start: 0x5d4872f4d640 len: 16}
2025-09-15 23:38:52.981<--1:info currmove a3b1
2025-09-15 23:38:52.981<--1:bestmove a3b1
2025-09-15 23:38:52.9811---------> Arena:Illegal move!: "bestmove a3b1" ()
this happened
don't worry it very helpfully has the move list
(2k5/8/8/7p/6bP/nR6/8/3K4 w - - 3 101 is the FEN)
currently hunting for the crash again
adding macros to bitboard.c where reasonable

i dont suppose you can nest macros
you can
pogs
macros can call macros
including dependency injection
when a macro is expanded it temporarily gets disabled
as in, a macro cant be expanded in its own expansion
thats basically the only limitation
also you should use ident concatenation in some cases


you can pass all 4 directions from all_dirs to each invocation
so the macro can access diametrically opposing directions
or 8 i guess

the bb slide commands still have to be custom tho
since they're tuned per direction
not copy-paste
uh
should i have put the macros in the header
thats why i recommended you to pass all 8 directions to each instantiation

wdym
noe noe macros accept all sort of thing
including symbol
no all 8 of these functions are different
#define all_dirs(x)
x(n, e, s, w)
x(e, s, w, n)
x(s, w, n, e)
x(w, n, e, s)
wtf is that
Thus the macrofication begins 
why would i do that
They're called X macros and they're great
ye x macros very useful
oh i see
i use in vm
now pass all dirs to each submacro()
wat why
no need
so you can access diametrically opposing dirs
The idea is that you have a list of things with the assumption that there's a macro
And then you just define said macro to be whatever you need 
so you can rotate the dir by an arbitrary degree in the macro code
nope im totally lost
trying to get me to use more macros when i already finished macroifying everything
awa
nop more macros always usable
Just be careful with macros shiro since they don't have symbols
use more macros to use less macros 
all trolling
ye it direct code subtitution
removing all macros

#define flip(n, ne, e, se, s, sw, w, nw) case dir_ ## n: return dir_ ## s;
switch (dir) {
_all_dirs(flip)
}


what does this even do

flip
flips the direction assuming _all_dirs passes all 8 dirs to x

it doesnt
and shouldn't
you can make it 
why would i do that
so you can dedupe this
you dont seem to get it

wait
maybe you do get it
no you dont 
im sure you can find some sequence of 3 or 4 macros that generates this but why
ye cant dedupe that
its just wasting my time
yea this is what i meant by "tuned per function" sorry if i wasnt clear
i didnt mean copy paste and swap a letter
i meant they're actually different
anyway
feel free to figure out which macros make that
probably one for ns modifications, one for ew modifications
i was talking about code like this
i see now
that makes sense
i still prob wont do that
im more concerned with code readability than macro shortness
i confuse
damn tournaments are funny
do i have separate defines in the header
to just generate declarations
or can i leave those
dont put them in the header if they arent part of the interface
if they're used for definitions but not declarations
honestly i'd either convert direction to enum or just keep it as is
better to keep interfaces explicit 
agree
would you rather direction as 8 functions for each operation
then macro 
so if i define _all_dirs macro in bitboard.c
and chessapi.c includes bitboard.h
does it have access to it

or must redefine

are there any legal moves in this position
i might have misread 
if there's 0 moves and arena doesnt turn off the chess bot then it will try to dereference the first element of get_legal_moves and segfault
expected behaviour
not worth the tokens to avoid

each c file is completely separate
each header is just code copypasted to include sites
i was worried about that

worried about the opposite actually
keeps my defines separate which is nice
ok
time to macro nuke the chess api
Analyse chess positions and variations on an interactive chess board
several
keep note of all these bugs bred will fix in a min


uci
isready
ucinewgame
position startpos moves e2e3 g7g6 g2g4 h7h5 c2c3 a7a6 c3c4 f8g7 f1h3 d7d5 h3g2 g7f8 d1c2 h5h4 c2d3 c8f5 g1e2 f7f6 h2h3 a8a7 g2e4 a6a5 f2f3 e8d7 e1d1 b7b5 e2g3 e7e5 d3e2 h8h7 d1e1 f8e7 h1g1 f5g4 h3g4 b5c4 g1f1 e7a3 f1f2 c7c5 f3f4 d8b6 e2c4 h7h8 b1a3 h8h5 f2g2 b6b7 a1b1 d5c4 g3f5 b7c8 b2b4 c8c6 g4h5 a7a6 e1f1 c6d6 g2g6 d7d8 e4c6 b8c6 d2d3 d6e7 a3b5 e7g7 c1d2 e5e4 b1b2 c6b4 b5c7 b4d3 b2b7 d3e1 g6h6 c4c3 f5g7 d8d7 b7b1 a6d6 d2c1 h4h3 b1a1 d7c8 c1b2 e1d3 h6h7 d3f4 b2c1 d6d4 c7b5 f4e2 f1f2 d4d5 f2f1 e2f4 a1b1 c5c4 f1g1 c8d7 h7h6 f4g2 g7e6 d5d3 h6g6 d7e8 g6g5 g8e7 g5g3 g2h4 g1f2 h4g2 e6f8 d3d4 a2a4 d4d3 b5d6 e8d8 d6c8 d3d2 f2f1 d2e2 b1b4 g2e1 g3g1 e1d3 c1b2 e2c2 g1g8 c2c1 b2c1 d8c7 c8d6 e7g6 g8g6 c7d8 d6e8 c3c2 g6g1 d3f2 b4b2 d8e7 e8g7 f6f5 b2b1 f2d1 g1g6 h3h2 g6g1 d1b2 b1a1 e7f6 g7e8 f6f7 e8g7 c4c3 f8d7 b2c4 c1b2 c2c1r b2c1 h2h1r g7e6 f7e8 c1a3 f5f4 a1d1 c4e3 f1e1 f4f3 d7f6 e8f7 e6c7 h1h2 a3c1 h2c2 f6g8 e3d1 c7d5 f7e6 e1f1 c2h2 h5h6 e4e3 g1g3 e6d6 g3g7 h2g2 g7g2 d6c5 g2g7 e3e2
go wtime 299992 btime 300000 winc 0 binc 0
this crashes the C bot
if I had to guess its failing to parse the board or something
oooh wait are you assuming a max line length
perhaps
does that happen to be around
256 chars
or 1024 maybe
idk what the buffer was
shruge
find a chess game that long
if that doesnt count whitespace
its probably just over 1024
but it should count whitespace so
idk
784 chars (without whitespace)
oh wait if I copy in the go command with it then its 1028

wait no
"surely no game will exceed this! its a whole kb!"
so stingy with the buffers smh
tbh I only hit this when pitting two random bots against each other
honestly impressive
they never hit the 50 move draw?
or the threefold repetition?
ive had my own bots fight lots of times without hitting this issue

i wonder whats the longest game you could make
is it autoclaimed?
should be

50 moves since moving a pawn or capturing a piece is the condition
autoclaimed by Arena*
not the api
api will just not tell the bots 
how do i macro any of this
this is a problem for later
this is a nightmare to macro
so ~7100 moves is the theoretical maximum
ok
the code is just so specialized for performance
erm shimo
slight issue
dynamic size curzed
arena segfaulted
i uh

just had a tournament going between two of my bots
they were at like 480 moves last I checked
how tf do you run into utf-8 issues 
I wonder if arena has a funny hardcoded limit of 512 moves or something
idk the utf-8 is unrelated
i need a good logo for the tournament
and for announcement banner
ideas?
can i just put terminator in a rook hat
uci
isready
ucinewgame
position startpos moves g1h3 b8a6 b2b4 a6b8 c1b2 b7b5 d1c1 e7e6 b2e5 b8c6 e5f4 c6e7 c1b2 g7g6 b2c1 g8h6 g2g3 c7c6 h3g1 d7d5 f4h6 f8h6 b1a3 c6c5 f2f3 d8b6 c1d1 h6e3 a3c4 e3g1 f3f4 e8f8 e2e4 b6d8 d1h5 a7a5 c4a5 d5e4 a5c4 e7c6 h5h6 f8g8 f4f5 d8d4 a2a4 c6a7 f1h3 c8b7 e1f1 d4c4 f1e1 c4f1 h3f1 a7c6 f1b5 g1d4 h6e3 c6e5 a4a5 e5d3 e1e2 a8b8 e3h6 b8e8 a1e1 e4e3 c2c4 d4e5 b4c5 b7d5 f5f6 e5b8 h6e3 b8a7 e1c1 e6e5 c1b1 h7h5 b1d1 d3b4 c4d5 b4c2 h1e1 a7b8 d1c1 c2e1 e2f1 h5h4 b5c6 b8d6 d2d4 h8h6 c6b7 e8b8 d4e5 e1f3 c1c4 f3h2 f1g1 h2f1 e5d6 g6g5 e3g5 g8h8 g1f2 h8h7 g5f5 h7h8 c4h4 b8e8 h4h3 e8d8
go wtime 299992 btime 300000 winc 0 binc 0
much shorter but also crashes
gonna sleep now
good night 
bad night 
phrrr 
ok ill look into 
doesnt crash for me 

big mistake just made
forgot the trailing .
whole project

good thing i pushed chessapi.h like half an hour ago 
works on python bot too
are you sure you grabbed the new version of the API
am i sure i pushed the new version of the api
back to shrinking my bot 
sent
i really thought this would work 
as i mentioned macros cant be expanded within their own expansion
you have to create a separate macro for each arity
am i misunderstanding or is the goal just something like this
thats the goal
or do you want it to be recursive
but thats just a test
the end use case was gonna be function definitions
then i could leave off the curly braces and return type everywhere

thoughts? 

look at that token save
but of course they all have the same contents with that definition
its ok
i might not need it
im mangling my everything
im learning the tricks
always use the same generic variable names everywhere
so you can strip common patterns into defines
just a few more tokens

all return values are now named rv 
omg im so close now just like 20 more tokens
5 more
this code is a crime
I will hack d bus
System -end crash soo much
THIS IS WHAT REAL C PROGRAMMING LOOKS LIKE
i'm a washed c programmer 
???



any way to expand the defines and nothing else?
gdb gave function at least
gdb my beloved
now THAT is weird

is legal move checking magically broke or something now

im so lost
i think the bitboard macros broke the entire API

great
dope
but its like 200 bytes smaller it was so worth it
wtf
actually not too bad yet
wait
why don't you compile and just give it the binary
i haven't the foggiest idea what the context is
the context is i need my source code to be at most 1024 tokens
wow
ah
found it
i assumed !x was the same as x == 0
but !(-1) == true
its still acting
super weird
something else must be bugged
oh
because immediately after saying all that i put in x <= 0

putting my bot against the random bot
if i cant even beat this ive truly failed

well...
thats what i thought too
surely this is the c standard

bruh your thing is nonstandard
The result of the logical negation operator ! is 0 if the value of its operand compares unequal to
0, 1 if the value of its operand compares equal to 0. The result has type int. The expression !E is
equivalent to (0==E).
its also an enum instead of being strictly an int
god only knows what happens under the hood
can confirm
adding newlines at the end of the file
wow real
unless you're on ones complement
IM SO LUCKY
like a weirdo
two's complement is surely c standard
should be implementation defined iirc
— the corresponding value with sign bit 0 is negated (sign and magnitude);
— the sign bit has the value −(2M) (two’s complement);
— the sign bit has the value −(2M − 1) (ones’ complement).
indeed
it leaves it up to implementation to choose which one
Which of these applies is implementation-defined
if I run out of tokens again I think my next victim is );
💀
have you hit all the for and while loops yet?
for loops?
with macros
#define f(l)
yes I already did that that's what I'm trying to say
wow i thought you meant that you kept it that long
no lol that's just the macro name
#define tree_child tree->children[i] is also carrying crazy weight
those aren't tokens
won't have any effect
incredible
wait did you define a struct for that?
I need a struct for what I'm doing
why not just use adjacency list
with janky arrays
my data structure choice is fine
adding more array indexes is not good
you can only put certain things for y
y cannot contain a ,
or it delimits it
noe just use __VA_ARGS__ instead of y
#define IF(x, ...) if (x) { __VA_ARGS__; }
IF(a, b)
slowly but surely we're approaching functional programming
python programmers with no macros 

Goodmorning 
IF(x, a) has the same number of tokens as if (x) a;
wow
You have unlocked new role
sam
you know im just saying, its possible to entirely forego the x, if you
#define IF(...) if (x) { __VA_ARGS__; }
and just assume there is some x defined

💀
possibly, but what about a global bool 
you still need x =
so the two tokens you save are lost
not to mention you only save those tokens in the #define
and the x = is per usage
#define FUNC(ident, ...) ident() { __VA_ARGS__; }
// int x() { return 0; }
FUNC(int x, return 0)
@real sierra saves 1 token 
probably doesnt
im using ternaries everywhere
wow
rip
how many if statements
i think i already replaced || with *
or your if macro
10
replace with
condition&&f(x)&g(x)&h(x)...
i think its more efficient probably
reasoning?
the && is shorter than if
FUNC(int main, IF(1 and 2, return 0) return 1)
//expands to
int main() { if (1 && 2) { return 0; } return 1; }

int uwu();
bool x = 1;
x&&uwu()&uwu()&uwu();
well i didn't want to type
clever
wellididn'twanttotype
but not shorter unless your condition is very simple
ye since && is terminating
any complex conditions need () around them
let's see
you can remove the parentheses + semi colon into a single macro
could always use and
thats why i said (1 token)
you cant remove the parentheses
only works if x is a variable
#define q )&
int uwu();
bool x = 1;
x&&uwu( q uwu( q uwu();
#define IF(x, ...) (x) and {{ __VA_ARGS__; }}
this would work on clang or gcc
and space isn't token
no parentheses needed
it comes later in operator precedence
the double curly brace is to get the brace to evaluate
auto y = {{ x; }};
ye this is a thing you can do in clang and gcc
strangely these are the same number of tokens
#define IF(x, ...) if (x) BLK(__VA_ARGS__)
#define IF(x, ...) (x) and {{ __VA_ARGS__; }}
think again
-std=c23
its c++ slop
auto bad
auto bad
why auto bad
javascript feature 
its only useful when you need multi-d VLA return value
it not javascript feature, still strongly typed
bad bad bad 
i think you are wrong 
smh why use iterator when you can use pointer
must have long type name



typedef long long uwu;
wait
bruh
that mistake never occurred
if you wanted
more details behind why im doing this
i plan to host a chess bot tournament here where your entry is limited to 1024 tokens
wow

Shiro is intelligent

this is actually very W idea
you're welcome to participate
surely optimal strat is to generate a seed such that you write a binary purely from rng output from that seed then run that binary
no reading/writing files
only would take a few decillion years to get the seed
write a JIT then do the random number trick and run it from memory
#define IF(x, ...) if (x) BLK(__VA_ARGS__)
#define IF(x, ...) (x) and BLK(BLK(__VA_ARGS__))
#define IF(x, ...) x ? (__VA_ARGS__) : PARENS
all three of these are the same number of tokens

awful
think of all the tokens you'll save
token counter doesnt think so
every one of these i replace is
increasing the token count

ok for just
#define def #define
#define and &&
#define or ||
#define PARENS ()
swapping them to def reduces token count by 1
all future defines also save
so cost is amortized

well not amortized
no im counting this assuming both of them have the #define def #define
* instead of and
so cost is irrelevant
save 3 tokens
i haven't the foggiest idea how you all are counting tokens
#define def #define
#define BLK(...) { __VA_ARGS__; }
but swapping #define to def here increases tokens by 2

easy way to think of it is words + punctuation (roughly)
int x = 1; -> ["int", "x", "=", "1", ";"]
i mean in that case just dont use && or ||
and just use & or |
saves the same number of tokens without defines
wait wtf why is brew installing another llvm
i have like installed llvm like 3 times now
💀
ts me when i just want some rust to install

erm yes?
yes im aware that && is a terminating operator

then what tihs mean 
shro do you use the comma operator
bozo momento
considered it but couldnt find a situation that it saved tokens
in cases where it applicable
almost every , corresponds to one removed ;
it helps remove {}
also declare variables as early as possible and in bulk
e.g. not in loop body but outside of the loop
or just declare fewer

reuse variables better
^
if you reuse variables you can bake them into macros
helps reduce tokens and increase macro usefulness
ye which why i suggested
#define IF(...) if (x) BLK(__VA_ARGS__)
``` but no 
you need more time in oven 
im stuck on hard problem

soon 
once bred starts playing with their ai again and finds the last of the edge cases
contest is basically good to goo once this is done
i just want it thoroughly tested

goto 


no goto, take token 
hmm if it were memory or time optim i would think it would be fine
but code size optimization is actually so hard ong
small spoiler
in the Move struct, the origin and target squares are stored as BitBoards
where typedef uint64_t BitBoard
bitboard with what info
bit flip 1 = something there 
depends which bitboard it is
they store piece locations, theres one per color-type combo
each bit corresponds to a board square
in the move struct, bitboard just store square from and square to
what if you gave us an unsigned _BitInt(256) var;
idk how go from this to piece type without just pulling all piece bitboards and checking 
im not using c23 im pretty sure
unfort
-std=c23
it so easy

shimo do you know about __COUNTER__

maybe ill add the flag then
regardless, not switching bitboards from uint64_t
more helpful internally for them to be separate
14?
the black pawn bitboard has bits flipped for every square containing a black pawn

very nice internally, lots of fast ops since its all bitwise integer math
unfun on token limit
i do now 
isnt that op
not that op actually 
i was gonna use it in a for loop def but
actually no still op
#define concat_inner(a, b) a##b
#define concat(a, b) concat_inner(a, b)
#define erf concat(erf, __COUNTER__)
erf // erf0
erf // erf1
erf // erf2
#define c __COUNTER__
#define for_(l) for_v(i ## __COUNTER__, l)
#define for_v(var, l) for(int var=0;var<l;var++)
efine
wait what are the time limits for the computation of the bots
1 minute chess game
bots manage their time management
i saw this van gogh painting and thought "ai art" because of the palette
im not sure this works how you think it does






yes

might've found the bug








