-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
87 changed files
with
4,620 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
dist/* | ||
.vscode | ||
.clang-format | ||
.editorconfig |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
## About Ultimate Tic-Tac-Toe | ||
|
||
Ultimate Tic-Tac-Toe is a strategic variant of Tic-Tac-Toe where you have 9 Tic-Tac-Toe boards arranged in a 3x3 grid. The aim of the game is to win more small boards (3x3) to ultimately win the large board (3x3 of Boards). | ||
|
||
## Rules: | ||
|
||
1. The first player can place their piece anywhere on the large board. | ||
2. Your move determines the board where your opponent will make their next move. For example, if you place your piece in the top-right corner of a small board, your opponent must play in the top-right board. If your opponent then places their piece in the bottom-left corner of that board, you must now play in the bottom-left board. | ||
3. Small boards follow the same rules as regular Tic-Tac-Toe. You must get 3 in a row to win the small board. | ||
4. If your opponent sends you to a board that's already been won, you can choose any open spot on the entire board for your next move. | ||
5. The winner is the first player to win 3 small boards in a row, either horizontally, vertically or diagonally. | ||
6. If all 9 small boards are filled and no player has won 3 small boards in a row, the game is a draw. | ||
|
||
## App features | ||
|
||
- Play against a friend or against the computer, or watch the computer play against itself. | ||
- Choose between 5 difficulty levels for the computer, from an easy random move generator to a hard minimax algorithm. | ||
|
||
## Upcoming features | ||
|
||
- Player statistics | ||
- Harder AI | ||
|
||
## Credits | ||
Made with ♠ by Racso - [https://games.by.rac.so/fzero](https://games.by.rac.so/fzero) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
App( | ||
appid="racso_ultimate_tic_tac_toe", | ||
name="Ultimate Tic-Tac-Toe", | ||
apptype=FlipperAppType.EXTERNAL, | ||
entry_point="app_main", | ||
requires=["gui"], | ||
stack_size=8*1024, | ||
order=50, | ||
fap_description="Ultimate Tic-Tac-Toe: play on a big board, where each square is a Tic-Tac-Toe board itself!", | ||
fap_category="Games", | ||
fap_version="1.0", | ||
fap_author="Racso", | ||
fap_weburl="https://games.by.rac.so/flipper-zero", | ||
fap_icon="ultimate_tic_tac_toe.png", | ||
fap_icon_assets="images" | ||
) |
Empty file.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
## v1.0 | ||
|
||
- Initial release. | ||
- Game is fully playable. | ||
- Players or AI can play on both sides. | ||
- 5 difficulty levels for the computer available (based on random and minimax algorithms). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
/* | ||
Ultimate Tic-Tac-Toe. By Racso. | ||
https://rac.so | ||
Licensed under the GNU General Public License v3.0: https://www.gnu.org/licenses/gpl-3.0.en.html | ||
Copyright (C) 2023 Óscar F. Gómez | ||
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or (at your option) any later version. | ||
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. | ||
*/ | ||
|
||
#include "app.h" | ||
#include "app_gameplay.h" | ||
#include "scene_menu.h" | ||
#include "scene_game.h" | ||
#include "scene_credits.h" | ||
#include "scene_management.h" | ||
|
||
#include <dolphin/dolphin.h> | ||
#include <notification/notification.h> | ||
#include <notification/notification_messages.h> | ||
|
||
AppContext* app_alloc() { | ||
AppContext* app = malloc(sizeof(AppContext)); | ||
app->gameplay = gameplay_alloc(); | ||
|
||
app->gui = furi_record_open(RECORD_GUI); | ||
|
||
app->sceneManager = scene_manager_alloc(); | ||
scene_manager_attach_to_gui(app->sceneManager, app->gui); | ||
scene_manager_register_scene( | ||
app->sceneManager, | ||
SceneType_Menu, | ||
scene_alloc(menu_render_callback, NULL, menu_input_callback, NULL, app)); | ||
scene_manager_register_scene( | ||
app->sceneManager, | ||
SceneType_Credits, | ||
scene_alloc(credits_render_callback, NULL, credits_input_callback, NULL, app)); | ||
scene_manager_register_scene( | ||
app->sceneManager, | ||
SceneType_Game, | ||
scene_alloc( | ||
game_render_callback, | ||
game_tick_callback, | ||
game_handle_input, | ||
game_transition_callback, | ||
app)); | ||
return app; | ||
} | ||
|
||
void app_free(AppContext* app) { | ||
scene_manager_detach_from_gui(app->sceneManager, app->gui); | ||
scene_manager_free(app->sceneManager); | ||
furi_record_close(RECORD_GUI); | ||
gameplay_free(app->gameplay); | ||
free(app); | ||
} | ||
|
||
int32_t app_main(void* p) { | ||
UNUSED(p); | ||
|
||
dolphin_deed(DolphinDeedPluginGameStart); | ||
|
||
NotificationApp* notification = furi_record_open(RECORD_NOTIFICATION); | ||
notification_message_block(notification, &sequence_display_backlight_enforce_on); | ||
|
||
AppContext* app = app_alloc(); | ||
|
||
scene_manager_set_scene(app->sceneManager, SceneType_Menu); | ||
|
||
while(scene_manager_has_scene(app->sceneManager)) { | ||
scene_manager_tick(app->sceneManager); | ||
furi_delay_ms(100); | ||
} | ||
|
||
app_free(app); | ||
|
||
notification_message(notification, &sequence_display_backlight_enforce_auto); | ||
furi_record_close(RECORD_NOTIFICATION); | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
Ultimate Tic-Tac-Toe. By Racso. | ||
https://rac.so | ||
Licensed under the GNU General Public License v3.0: https://www.gnu.org/licenses/gpl-3.0.en.html | ||
Copyright (C) 2023 Óscar F. Gómez | ||
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or (at your option) any later version. | ||
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. | ||
*/ | ||
|
||
#include <gui/gui.h> | ||
|
||
typedef struct SceneManager SceneManager; | ||
typedef struct AppGameplayState AppGameplayState; | ||
|
||
typedef struct AppContext { | ||
Gui* gui; | ||
SceneManager* sceneManager; | ||
AppGameplayState* gameplay; | ||
|
||
} AppContext; | ||
|
||
typedef enum SceneType { | ||
SceneType_None, | ||
SceneType_Menu, | ||
SceneType_Game, | ||
SceneType_Credits, | ||
} SceneType; |
Oops, something went wrong.