Files
cudoku/cudoku.h
T

41 lines
967 B
C
Raw Normal View History

#pragma once
#include <stdbool.h>
#include "shader.h"
#include "timer.h"
#include "ui.h"
2023-09-12 23:32:58 +02:00
typedef struct Cell {
int value;
bool is_locked;
} Cell;
2023-09-12 23:32:58 +02:00
typedef struct Cudoku {
Cell board[9][9];
2023-09-14 01:41:39 +02:00
int solution[9][9];
2023-09-12 23:32:58 +02:00
bool has_won;
Vec2 selection;
bool should_draw_selection;
bool should_highlight_mistakes;
2023-10-02 23:59:48 +02:00
bool should_draw_help;
Timer help_timer;
Timer timer;
float win_time;
2023-09-12 23:32:58 +02:00
} Cudoku;
2023-11-29 05:28:54 +02:00
void draw_selection_box(int x, int y, const Color color);
void highlight_mistakes(Cudoku *game);
void toggle_check(Cudoku *game);
2023-11-29 05:28:54 +02:00
void do_selection(Cudoku *game, int x, int y);
2023-09-12 23:32:58 +02:00
void set_selected_number(Cudoku *game, int number);
void move_selection(Cudoku *game, int x, int y);
void toggle_selection(Cudoku *game);
2023-09-14 01:41:39 +02:00
void generate_random_board(Cudoku *game);
void reset_board(Cudoku *game);
bool toggle_help(Cudoku *game);
2023-11-26 21:32:19 +02:00
void draw_help(Timer *timer);
2023-11-26 05:34:42 +02:00
void draw_timer(Timer *timer);
2023-11-26 03:58:40 +02:00
void draw_win(Cudoku *game);
2023-11-26 21:32:19 +02:00
void draw_board(Cudoku *game, Size window_size);