Take value prebaking to the extreme! inspired by "even-odd else ifs" meme. The resultant lookup table occupies ~21GB file. Just a small for fun project.
- Git
- GNU Make
- TinyCC C Compiler (tcc)
Why TCC is used is because it's small and fast, and it generates small executable binary too.
git clone https://github.com/EmiyaSyahriel/evenodd_lut
cd evenodd_lut
make
Makefile will automatically detect OS you're compiling in
You can substitute the
exe
toelf
if you are in linux
tcc -o makelkup.exe makelkup.c
./makelkup.exe
tcc -o evenodds.exe evenodds.c
tcc -o evenoddl.exe evenoddl.c
You can substitute the
exe
toelf
if you are in linux
Generates the lookup table
Even-odd app using algorithm
Even-odd app using lookup table. (requires evenodds.lut
)
Lookup table for the even odd app.
CC-BY 4.0 (see LICENSE file)
You can use this code as you want as long as when you share even the modified version it, you gave the attribution to me for this exact code files.