Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v6
- uses: actions/checkout@v5
- uses: actions/setup-python@v7
with:
python-version: "3.13"
- name: Install PlatformIO
Expand All @@ -20,7 +20,7 @@ jobs:
run: pio run
- name: Test game logic
run: |
g++ -std=c++17 -Wall -Wextra -Werror -Iinclude test/puzzle_logic_test.cpp -o /tmp/puzzle_logic_test
g++ -std=c++17 -Wall -Wextra -Werror -Iinclude -Icore/include test/puzzle_logic_test.cpp -o /tmp/puzzle_logic_test
/tmp/puzzle_logic_test
g++ -std=c++17 -Wall -Wextra -Werror -Iinclude test/mastermind_logic_test.cpp -o /tmp/mastermind_logic_test
g++ -std=c++17 -Wall -Wextra -Werror -Iinclude -Icore/include test/mastermind_logic_test.cpp -o /tmp/mastermind_logic_test
/tmp/mastermind_logic_test
10 changes: 10 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

350 changes: 350 additions & 0 deletions .idea/editor.xml

Large diffs are not rendered by default.

25 changes: 25 additions & 0 deletions .idea/jsonSchemas.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 24 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 27 additions & 0 deletions .idea/runConfigurations/Build_CYD_no_upload.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 25 additions & 0 deletions .idea/runConfigurations/Flash_CYD_Monitor.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 26 additions & 0 deletions .idea/runConfigurations/Flash_CYD_both_boards.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .idea/runConfigurations/Monitor_Both_CYDs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 25 additions & 0 deletions .idea/runConfigurations/Monitor_CYD_USB0.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 25 additions & 0 deletions .idea/runConfigurations/Monitor_CYD_USB1.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

50 changes: 50 additions & 0 deletions content/conundrum/default_words.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
BLUEPRINT|TNPULEBRI|A detailed plan or design
COUNTDOWN|DTWNOCNUO|A backward sequence before an event
STARTLING|GTLNRSAIT|Surprising or astonishing
CARPETING|TICNGPEAR|Floor covering material
GRENADIER|AIGNRDERE|A type of soldier
PETROLEUM|MOUERTPLE|Crude oil and its derivatives
RECTANGLE|CTRELAGNE|A four-sided flat shape
IMPORTANT|TNAMIPORT|Of great significance
SPECTATOR|POSTCATER|Someone watching an event
TRANSPORT|RNOTTARPS|Moving people or goods
CARNATION|TONRAANIC|A type of flower
CELEBRATE|EBTELRACE|To mark a happy occasion
DEMANDING|DEMNIGDAN|Requiring great effort
ELABORATE|EOBARATEL|Detailed and complicated
FORMATION|IOATONMRF|An arrangement or pattern
GREATNESS|ESNAERTGS|The quality of being great
HAPPINESS|NASEPHSIP|The state of being happy
IDENTICAL|TCALDENII|Exactly the same
MILESTONE|EMILESOTN|A significant achievement
NIGHTMARE|HIRMNGETA|A very frightening dream
ORCHESTRA|OCHRTRASE|A large group of musicians
PARACHUTE|PHATACRUO|Device for safe descent
QUALITIES|SQUITAILE|Characteristics or features
RASPBERRY|BSYRARPRE|A red or black berry
SCULPTURE|LCETRSUPU|A three-dimensional artwork
TESTIMONY|STIOYMNTE|A formal statement
UNCERTAIN|NCTEUNRAI|Not definitely known
VALENTINE|VLANITEEN|A token of love or affection
WATERFALL|LTFEARAWL|Water falling from a height
YESTERDAY|SEATDREHY|The day before today
ZEALOUSLY|LOUZSYEAL|With great enthusiasm
AFTERMATH|RFTHMAAET|Consequences of an event
BRILLIANT|BTRANLILI|Very bright or intelligent
CHEMISTRY|RHMYSTICE|The science of substances
DIALOGUES|GODSILEAU|Conversations in text
ELEPHANTS|PHANTELSE|Large grey mammals
FIREWORKS|RFISWOKRE|Explosive displays of light
GEOGRAPHY|PHYROEAGP|The study of the earth
HURRICANE|NARRIHUCE|A violent tropical storm
INVISIBLE|SINIBVILE|Unable to be seen
JUDGEMENT|JDTUGEMEN|An opinion or decision
LABYRINTH|NLBHYTIRA|A maze or complex system
MECHANISM|MHCNIAMSE|A system of moving parts
NOTORIOUS|TOUNORISE|Well known for a bad reason
OPERATION|PNOOAIRET|A process or procedure
PARCHMENT|PRACMNHET|A writing material
QUARTERLY|TAYRLEQU|Happening four times a year
RELENTLESS|SLNLEETER|Without stopping or weakening
SUBMARINE|BNMAURIES|An underwater vessel
TORMENTED|DTRMONETE|Caused to suffer greatly
53 changes: 27 additions & 26 deletions core/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
/**
* Flip7 Core CMake Build
* Shared C++ library for protocol, game logic, and reconciliation
*/
# Flip7 Core CMake Build
# Shared C++ library for protocol, game logic, and reconciliation

cmake_minimum_required(VERSION 3.16)
project(flip7core LANGUAGES CXX)
Expand All @@ -18,11 +16,14 @@ add_library(flip7core STATIC
src/mastermind.cpp
src/reconciliation.cpp
src/active_game.cpp
src/countdown_engine.cpp
)

target_include_directories(flip7core
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/flip7>
$<INSTALL_INTERFACE:include>
$<INSTALL_INTERFACE:include/flip7>
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/src
Expand All @@ -35,9 +36,9 @@ target_compile_options(flip7core PRIVATE
)

# Install headers
install(DIRECTORY include/flip7/
DESTINATION include/flip7
FILES_MATCHING PATTERN "*.hpp"
install(DIRECTORY include/
DESTINATION include
FILES_MATCHING PATTERN "*.h" PATTERN "*.hpp"
)

install(TARGETS flip7core
Expand All @@ -57,8 +58,7 @@ if(BUILD_TESTS)
tests/protocol_test.cpp
tests/serialization_test.cpp
tests/reconciliation_test.cpp
tests/mastermind_test.cpp
tests/puzzle_test.cpp
tests/countdown_test.cpp
)

target_link_libraries(flip7core_tests PRIVATE
Expand All @@ -70,22 +70,23 @@ if(BUILD_TESTS)
add_test(NAME flip7core_tests COMMAND flip7core_tests)
endif()

# Package config
include(CMakePackageConfigHelpers)
write_basic_package_version_file(
${CMAKE_CURRENT_BINARY_DIR}/flip7coreConfigVersion.cmake
VERSION 1.0.0
COMPATIBILITY SameMajorVersion
)
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/cmake/flip7coreConfig.cmake.in")
include(CMakePackageConfigHelpers)
write_basic_package_version_file(
${CMAKE_CURRENT_BINARY_DIR}/flip7coreConfigVersion.cmake
VERSION 1.0.0
COMPATIBILITY SameMajorVersion
)

configure_package_config_file(
cmake/flip7coreConfig.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/flip7coreConfig.cmake
INSTALL_DESTINATION lib/cmake/flip7core
)
configure_package_config_file(
cmake/flip7coreConfig.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/flip7coreConfig.cmake
INSTALL_DESTINATION lib/cmake/flip7core
)

install(FILES
${CMAKE_CURRENT_BINARY_DIR}/flip7coreConfig.cmake
${CMAKE_CURRENT_BINARY_DIR}/flip7coreConfigVersion.cmake
DESTINATION lib/cmake/flip7core
)
install(FILES
${CMAKE_CURRENT_BINARY_DIR}/flip7coreConfig.cmake
${CMAKE_CURRENT_BINARY_DIR}/flip7coreConfigVersion.cmake
DESTINATION lib/cmake/flip7core
)
endif()
16 changes: 16 additions & 0 deletions core/include/flip7/conundrum_table.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#pragma once

#include <cstddef>

namespace flip7::countdown {

struct ConundrumEntry {
const char* solution;
const char* scramble;
const char* hint;
};

extern const ConundrumEntry kConundrumTable[];
extern const std::size_t kConundrumTableSize;

} // namespace flip7::countdown
Loading