added simulation file for actually performing sim

This commit is contained in:
2026-03-17 23:21:47 +00:00
parent 5110ce8c42
commit 23add2c55f
5 changed files with 116 additions and 31 deletions

View File

@@ -16,35 +16,6 @@
#include "bf.h"
static char *VALID_OPS = "<>{}-+.,[]";
u8 get_op(const u8 cell)
{
if (strchr(VALID_OPS, cell))
return cell;
else
return '\0';
}
Color simulation_cell_color(const u8 cell)
{
const Color possible_colors[] = {
['<'] = ColorFromHSV(0.121, 0.467, 0.706),
['>'] = ColorFromHSV(1.000, 0.498, 0.055),
['{'] = ColorFromHSV(0.173, 0.627, 0.173),
['}'] = ColorFromHSV(0.839, 0.153, 0.157),
['-'] = ColorFromHSV(0.580, 0.404, 0.741),
['+'] = ColorFromHSV(0.549, 0.337, 0.294),
['.'] = ColorFromHSV(0.890, 0.467, 0.761),
[','] = ColorFromHSV(0.498, 0.498, 0.498),
['['] = ColorFromHSV(0.737, 0.741, 0.133),
[']'] = ColorFromHSV(0.090, 0.745, 0.812),
['\0'] = BLACK,
};
return possible_colors[get_op(cell)];
}
int main(void)
{
srand(time(NULL));