Author SHA1 Message Date
laemmerzahlkr91200 3a021f72a2 counter fix (again) 2025-12-15 12:29:09 +01:00
laemmerzahlkr91200 560cc4a762 Counter fix and Logik-Deadlock Fix 2025-12-15 12:17:18 +01:00
linkse100241 0d6403a0b8 gitignore update 2025-12-15 11:51:08 +01:00
laemmerzahlkr91200 f93d72a184 Update .gitignore 2025-12-15 11:48:13 +01:00
laemmerzahlkr91200 3258531c32 Merge branch 'Project_Developer' of https://git.efi.th-nuernberg.de/gitea/linkse100241/prog3b_652 into Project_Developer 2025-12-15 11:40:07 +01:00
laemmerzahlkr91200 31280508ec Bugfix Game 2025-12-15 11:39:51 +01:00
laemmerzahlkr91200 33e70cbf41 Big Bugfix 2025-12-14 16:52:55 +01:00
laemmerzahlkr91200 4b097a7ee2 Tipps und Anweisungen in der Main.cpp
Hausaufgaben
2025-12-01 13:00:44 +01:00
laemmerzahlkr91200 7e36ccf7fb current 2025-12-01 12:58:30 +01:00
laemmerzahlkr91200 925b0f69ee What to do in GameWon 2025-12-01 12:50:56 +01:00
laemmerzahlkr91200 68aa8831b7 a update 2025-12-01 12:40:30 +01:00
1nn0c3ntt 7593e4d1c8 Merge branch 'Project_Developer' of https://git.efi.th-nuernberg.de/gitea/linkse100241/prog3b_652 into Project_Developer 2025-12-01 12:38:09 +02:00
laemmerzahlkr91200 80d968f642 fix 2025-12-01 12:28:50 +01:00
1nn0c3ntt a6b1c52b7d legen wir fest, in welchem Zustand das Spiel startet 2025-12-01 12:37:43 +02:00
1nn0c3ntt 47becca88b Merge branch 'Project_Developer' of https://git.efi.th-nuernberg.de/gitea/linkse100241/prog3b_652 into Project_Developer 2025-12-01 12:26:54 +02:00
laemmerzahlkr91200 b4821e9f48 Runs now on Gamematrix
removed "libgamematrix.a"
2025-12-01 12:02:11 +01:00
linkse100241 974f753b21 gitignore added 2025-12-01 11:50:33 +01:00
1nn0c3ntt a421249213 Gamestate implimentiert 2025-12-01 12:25:58 +02:00
laemmerzahlkr91200 c58afda0a7 Counter + Variable added
Zähler und unterschiedliche Würfelmenge hinzugefügt
2025-11-30 19:09:02 +01:00
laemmerzahlkr91200 5e750e1ce7 f 2025-11-29 16:56:04 +01:00
laemmerzahlkr91200 b5fe0d994f fix 2025-11-29 16:31:41 +01:00
laemmerzahlkr91200 1755db0b69 update from test 2025-11-29 15:43:46 +01:00
laemmerzahlkr91200 f829380338 ? 2025-11-17 11:55:13 +01:00
laemmerzahlkr91200 681ce6c838 fix (remove old) 2025-11-17 11:50:15 +01:00
laemmerzahlkr91200 6903115012 nerv nicht git 2025-11-17 11:40:09 +01:00
laemmerzahlkr91200 cb97261672 _Nachtrag
Bug fix
2025-11-09 17:29:05 +01:00
laemmerzahlkr91200 3d346a3789 Complete?
Sollte fertig sein
2025-11-09 17:18:17 +01:00
laemmerzahlkr91200 9d71e1cfea Create gamematrix.exe 2025-11-09 16:59:15 +01:00
laemmerzahlkr91200 a783e001b9 Matrix 2025-11-09 16:56:55 +01:00
laemmerzahlkr91200 adec566482 Create TestingGround_ChatGPT_Kris.cpp
Upload_TestingGround
2025-11-09 13:56:51 +01:00
laemmerzahlkr91200 42b97e0958 test_home 2025-11-09 13:11:54 +01:00
laemmerzahlkr91200 35311c2eca do it 2025-11-03 12:45:23 +01:00
laemmerzahlkr91200 3c5ed29c41 Create Test_Developer_This_is_my_Branch.txt 2025-11-03 12:19:10 +01:00
19 changed files with 721 additions and 195 deletions
+12
View File
@@ -0,0 +1,12 @@
# Ignore CMake build directories
cmake-build-debug/
cmake-build-release/
# General build artifacts
build/
out/
*.o
*.obj
*.log
.idea/
+56 -56
View File
@@ -244,55 +244,61 @@
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=StdIsConstantEvaluatedWillAlwaysEvaluateToConstant/@EntryIndexedValue" value="WARNING" type="string" /> <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=StdIsConstantEvaluatedWillAlwaysEvaluateToConstant/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=StringLiteralTypo/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" /> <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=StringLiteralTypo/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppClangFormat/EnableClangFormatSupport/@EntryValue" value="false" type="bool" /> <option name="/Default/CodeStyle/CodeFormatting/CppClangFormat/EnableClangFormatSupport/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_ARGUMENT/@EntryValue" value="true" type="bool" /> <option name="/Default/CodeStyle/EditorConfig/EnableClangFormatSupport/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_BINARY_EXPRESSIONS_CHAIN/@EntryValue" value="true" type="bool" /> <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_BINARY_EXPRESSIONS_CHAIN/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_CALLS_CHAIN/@EntryValue" value="false" type="bool" /> <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_CALLS_CHAIN/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_EXPRESSION/@EntryValue" value="false" type="bool" /> <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_EXPRESSION/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_EXTENDS_LIST/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_FOR_STMT/@EntryValue" value="true" type="bool" /> <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_FOR_STMT/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTIPLE_DECLARATION/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_TERNARY/@EntryValue" value="ALIGN_ALL" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/BLANK_LINES_AROUND_CLASS_DEFINITION/@EntryValue" value="1" type="int" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/KEEP_BLANK_LINES_IN_DECLARATIONS/@EntryValue" value="2" type="int" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/KEEP_BLANK_LINES_IN_CODE/@EntryValue" value="2" type="int" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/KEEP_USER_LINEBREAKS/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INDENT_CASE_FROM_SWITCH/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INDENT_COMMENT/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INT_ALIGN_EQ/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SIMPLE_BLOCK_STYLE/@EntryValue" value="DO_NOT_CHANGE" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_COMMA_IN_TEMPLATE_ARGS/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_COMMA_IN_TEMPLATE_PARAMS/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_FOR_SEMICOLON/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_FOR_SEMICOLON/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_UNARY_OPERATOR/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_ARRAY_ACCESS_BRACKETS/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_CAST_EXPRESSION_PARENTHESES/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_EMPTY_INITIALIZER_BRACES/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_EMPTY_METHOD_PARENTHESES/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_INITIALIZER_BRACES/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPECIAL_ELSE_IF_TREATMENT/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_CAST_EXPRESSION_PARENTHESES/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_AFTER_BINARY_OPSIGN/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_BEFORE_TERNARY_OPSIGNS/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/TYPE_DECLARATION_BRACES/@EntryValue" value="END_OF_LINE" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/OTHER_BRACES/@EntryValue" value="END_OF_LINE" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/CASE_BLOCK_BRACES/@EntryValue" value="END_OF_LINE" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/BLANK_LINES_AROUND_FUNCTION_DECLARATION/@EntryValue" value="1" type="int" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/BLANK_LINES_AROUND_FUNCTION_DEFINITION/@EntryValue" value="1" type="int" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/PLACE_WHILE_ON_NEW_LINE/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/PLACE_ELSE_ON_NEW_LINE/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/PLACE_CATCH_ON_NEW_LINE/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/NAMESPACE_INDENTATION/@EntryValue" value="All" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_ARGUMENT/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_EXTENDS_LIST/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_PARAMETER/@EntryValue" value="true" type="bool" /> <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_PARAMETER/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_TYPE_ARGUMENT/@EntryValue" value="false" type="bool" /> <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_TYPE_ARGUMENT/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_TYPE_PARAMETER/@EntryValue" value="false" type="bool" /> <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_TYPE_PARAMETER/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTIPLE_DECLARATION/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_TERNARY/@EntryValue" value="ALIGN_ALL" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ANONYMOUS_METHOD_DECLARATION_BRACES/@EntryValue" value="END_OF_LINE" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/BLANK_LINES_AROUND_CLASS_DEFINITION/@EntryValue" value="1" type="int" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/BLANK_LINES_AROUND_DECLARATIONS/@EntryValue" value="0" type="int" /> <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/BLANK_LINES_AROUND_DECLARATIONS/@EntryValue" value="0" type="int" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/BLANK_LINES_AROUND_FUNCTION_DECLARATION/@EntryValue" value="1" type="int" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/BLANK_LINES_AROUND_FUNCTION_DEFINITION/@EntryValue" value="1" type="int" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/BREAK_TEMPLATE_DECLARATION/@EntryValue" value="LINE_BREAK" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/CASE_BLOCK_BRACES/@EntryValue" value="END_OF_LINE" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/CONTINUOUS_LINE_INDENT/@EntryValue" value="Double" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/FREE_BLOCK_BRACES/@EntryValue" value="END_OF_LINE" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INDENT_ACCESS_SPECIFIERS_FROM_CLASS/@EntryValue" value="false" type="bool" /> <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INDENT_ACCESS_SPECIFIERS_FROM_CLASS/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INDENT_CASE_FROM_SWITCH/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INDENT_CLASS_MEMBERS_FROM_ACCESS_SPECIFIERS/@EntryValue" value="true" type="bool" /> <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INDENT_CLASS_MEMBERS_FROM_ACCESS_SPECIFIERS/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INDENT_COMMENT/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INDENT_SIZE/@EntryValue" value="4" type="int" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INDENT_STYLE/@EntryValue" value="Space" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INITIALIZER_BRACES/@EntryValue" value="END_OF_LINE_NO_SPACE" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INT_ALIGN_EQ/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INVOCABLE_DECLARATION_BRACES/@EntryValue" value="END_OF_LINE" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/KEEP_BLANK_LINES_IN_CODE/@EntryValue" value="2" type="int" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/KEEP_BLANK_LINES_IN_DECLARATIONS/@EntryValue" value="2" type="int" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/KEEP_USER_LINEBREAKS/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/LINE_BREAK_AFTER_COLON_IN_MEMBER_INITIALIZER_LISTS/@EntryValue" value="ON_SINGLE_LINE" type="string" /> <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/LINE_BREAK_AFTER_COLON_IN_MEMBER_INITIALIZER_LISTS/@EntryValue" value="ON_SINGLE_LINE" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/MEMBER_INITIALIZER_LIST_STYLE/@EntryValue" value="DO_NOT_CHANGE" type="string" /> <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/MEMBER_INITIALIZER_LIST_STYLE/@EntryValue" value="DO_NOT_CHANGE" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/NAMESPACE_DECLARATION_BRACES/@EntryValue" value="END_OF_LINE" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/NAMESPACE_INDENTATION/@EntryValue" value="All" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/OTHER_BRACES/@EntryValue" value="END_OF_LINE" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/PLACE_CATCH_ON_NEW_LINE/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/PLACE_ELSE_ON_NEW_LINE/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/PLACE_NAMESPACE_DEFINITIONS_ON_SAME_LINE/@EntryValue" value="false" type="bool" /> <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/PLACE_NAMESPACE_DEFINITIONS_ON_SAME_LINE/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/PLACE_WHILE_ON_NEW_LINE/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SIMPLE_BLOCK_STYLE/@EntryValue" value="DO_NOT_CHANGE" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_CAST_EXPRESSION_PARENTHESES/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_COLON_IN_BITFIELD_DECLARATOR/@EntryValue" value="true" type="bool" /> <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_COLON_IN_BITFIELD_DECLARATOR/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_COMMA_IN_TEMPLATE_ARGS/@EntryValue" value="true" type="bool" /> <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_COLON_IN_BITFIELD_DECLARATOR/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_COMMA_IN_TEMPLATE_PARAMS/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_EXTENDS_COLON/@EntryValue" value="true" type="bool" /> <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_EXTENDS_COLON/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_EXTENDS_COLON/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_FOR_COLON/@EntryValue" value="true" type="bool" /> <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_FOR_COLON/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_FOR_SEMICOLON/@EntryValue" value="true" type="bool" /> <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_FOR_COLON/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_PTR_IN_DATA_MEMBER/@EntryValue" value="false" type="bool" /> <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_PTR_IN_DATA_MEMBER/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_PTR_IN_DATA_MEMBERS/@EntryValue" value="false" type="bool" /> <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_PTR_IN_DATA_MEMBERS/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_PTR_IN_METHOD/@EntryValue" value="false" type="bool" /> <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_PTR_IN_METHOD/@EntryValue" value="false" type="bool" />
@@ -300,11 +306,6 @@
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_REF_IN_DATA_MEMBER/@EntryValue" value="false" type="bool" /> <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_REF_IN_DATA_MEMBER/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_REF_IN_DATA_MEMBERS/@EntryValue" value="false" type="bool" /> <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_REF_IN_DATA_MEMBERS/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_REF_IN_METHOD/@EntryValue" value="false" type="bool" /> <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_REF_IN_METHOD/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_UNARY_OPERATOR/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_COLON_IN_BITFIELD_DECLARATOR/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_EXTENDS_COLON/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_FOR_COLON/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_FOR_SEMICOLON/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_PTR_IN_ABSTRACT_DECL/@EntryValue" value="true" type="bool" /> <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_PTR_IN_ABSTRACT_DECL/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_PTR_IN_DATA_MEMBER/@EntryValue" value="true" type="bool" /> <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_PTR_IN_DATA_MEMBER/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_PTR_IN_DATA_MEMBERS/@EntryValue" value="true" type="bool" /> <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_PTR_IN_DATA_MEMBERS/@EntryValue" value="true" type="bool" />
@@ -316,29 +317,28 @@
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_TEMPLATE_ARGS/@EntryValue" value="false" type="bool" /> <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_TEMPLATE_ARGS/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_TEMPLATE_PARAMS/@EntryValue" value="false" type="bool" /> <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_TEMPLATE_PARAMS/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BETWEEN_CLOSING_ANGLE_BRACKETS_IN_TEMPLATE_ARGS/@EntryValue" value="true" type="bool" /> <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BETWEEN_CLOSING_ANGLE_BRACKETS_IN_TEMPLATE_ARGS/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_ARRAY_ACCESS_BRACKETS/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_CAST_EXPRESSION_PARENTHESES/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_DECLARATION_PARENTHESES/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_EMPTY_BLOCKS/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_EMPTY_INITIALIZER_BRACES/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_EMPTY_METHOD_PARENTHESES/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_EMPTY_TEMPLATE_PARAMS/@EntryValue" value="false" type="bool" /> <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_EMPTY_TEMPLATE_PARAMS/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_INITIALIZER_BRACES/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_TEMPLATE_ARGS/@EntryValue" value="false" type="bool" /> <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_TEMPLATE_ARGS/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_TEMPLATE_PARAMS/@EntryValue" value="false" type="bool" /> <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_TEMPLATE_PARAMS/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPECIAL_ELSE_IF_TREATMENT/@EntryValue" value="true" type="bool" /> <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_DECLARATION_PARENTHESES/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/TAB_WIDTH/@EntryValue" value="4" type="int" /> <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_EMPTY_BLOCKS/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/TYPE_DECLARATION_BRACES/@EntryValue" value="END_OF_LINE" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_AFTER_BINARY_OPSIGN/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_AFTER_DECLARATION_LPAR/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_AFTER_INVOCATION_LPAR/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_ARGUMENTS_STYLE/@EntryValue" value="WRAP_IF_LONG" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_BEFORE_DECLARATION_LPAR/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_BEFORE_DECLARATION_RPAR/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_BEFORE_INVOCATION_LPAR/@EntryValue" value="false" type="bool" /> <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_BEFORE_INVOCATION_LPAR/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_AFTER_INVOCATION_LPAR/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_BEFORE_INVOCATION_RPAR/@EntryValue" value="false" type="bool" /> <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_BEFORE_INVOCATION_RPAR/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_BEFORE_TERNARY_OPSIGNS/@EntryValue" value="true" type="bool" /> <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_BEFORE_DECLARATION_LPAR/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_AFTER_DECLARATION_LPAR/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_BEFORE_DECLARATION_RPAR/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_ARGUMENTS_STYLE/@EntryValue" value="WRAP_IF_LONG" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_PARAMETERS_STYLE/@EntryValue" value="WRAP_IF_LONG" type="string" /> <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_PARAMETERS_STYLE/@EntryValue" value="WRAP_IF_LONG" type="string" />
<option name="/Default/CodeStyle/EditorConfig/EnableClangFormatSupport/@EntryValue" value="false" type="bool" /> <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/BREAK_TEMPLATE_DECLARATION/@EntryValue" value="LINE_BREAK" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/NAMESPACE_DECLARATION_BRACES/@EntryValue" value="END_OF_LINE" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/FREE_BLOCK_BRACES/@EntryValue" value="END_OF_LINE" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INVOCABLE_DECLARATION_BRACES/@EntryValue" value="END_OF_LINE" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ANONYMOUS_METHOD_DECLARATION_BRACES/@EntryValue" value="END_OF_LINE" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INITIALIZER_BRACES/@EntryValue" value="END_OF_LINE_NO_SPACE" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INDENT_STYLE/@EntryValue" value="Space" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INDENT_SIZE/@EntryValue" value="4" type="int" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/CONTINUOUS_LINE_INDENT/@EntryValue" value="Double" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/TAB_WIDTH/@EntryValue" value="4" type="int" />
</component> </component>
</project> </project>
-6
View File
@@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding">
<file url="file://$PROJECT_DIR$/windows/libgamematrix.a" charset="ISO-8859-1" />
</component>
</project>
-1
View File
@@ -1 +0,0 @@
hallo
+42 -17
View File
@@ -1,59 +1,84 @@
cmake_minimum_required(VERSION 3.28) cmake_minimum_required(VERSION 3.28)
project(Prog3B) project(Prog3B)
set(EXECUTABLE_NAME Prog3B) set(EXECUTABLE_NAME Prog3B)
# Generate compile_commands.json # -------------------------------------------------
# Global settings
# -------------------------------------------------
set(CMAKE_EXPORT_COMPILE_COMMANDS ON) set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# -------------------------------------------------
# Main executable
# -------------------------------------------------
set(SRC_FILES set(SRC_FILES
src/main.cpp src/main.cpp
src/gamecube.cpp src/gamecube.cpp
src/gamematrix.cpp src/gamematrix.cpp
) )
add_executable(${EXECUTABLE_NAME} ${SRC_FILES}) add_executable(${EXECUTABLE_NAME} ${SRC_FILES})
target_include_directories(${EXECUTABLE_NAME} PRIVATE target_include_directories(${EXECUTABLE_NAME} PRIVATE
${CMAKE_CURRENT_LIST_DIR}/includes ${CMAKE_CURRENT_LIST_DIR}/includes
${CMAKE_CURRENT_LIST_DIR}/raylib ${CMAKE_CURRENT_LIST_DIR}/raylib
) )
# -------------------------------------------------
# Tests executable
# -------------------------------------------------
set(TEST_FILES set(TEST_FILES
src/tests.cpp
src/gamematrix.cpp src/gamematrix.cpp
) )
add_executable(tests ${TEST_FILES}) add_executable(tests ${TEST_FILES})
target_include_directories(tests PRIVATE target_include_directories(tests PRIVATE
${CMAKE_CURRENT_LIST_DIR}/includes ${CMAKE_CURRENT_LIST_DIR}/includes
) )
# -------------------------------------------------
if(WIN32) # Platform specific linking
# -------------------------------------------------
if (WIN32)
message(STATUS "Configuring for Windows") message(STATUS "Configuring for Windows")
target_link_libraries(${EXECUTABLE_NAME} PRIVATE target_link_libraries(${EXECUTABLE_NAME} PRIVATE
${CMAKE_CURRENT_LIST_DIR}/windows/libgamematrix.a
${CMAKE_CURRENT_LIST_DIR}/windows/libraylib.a ${CMAKE_CURRENT_LIST_DIR}/windows/libraylib.a
opengl32 gdi32 winmm opengl32
gdi32
winmm
) )
elseif(APPLE)
message(STATUS "Configuring for MacOS") elseif (APPLE)
message(STATUS "Configuring for macOS")
target_link_libraries(${EXECUTABLE_NAME} PRIVATE target_link_libraries(${EXECUTABLE_NAME} PRIVATE
${CMAKE_CURRENT_LIST_DIR}/mac_x86/libgamematrix.a
${CMAKE_CURRENT_LIST_DIR}/mac_x86/libraylib.a ${CMAKE_CURRENT_LIST_DIR}/mac_x86/libraylib.a
"-framework IOKit"
"-framework Cocoa" "-framework Cocoa"
"-framework OpenGL" "-framework OpenGL"
"-framework IOKit"
) )
else()
# --- Linux --- else ()
message(STATUS "Configuring for Linux") message(STATUS "Configuring for Linux")
target_link_libraries(${EXECUTABLE_NAME} PRIVATE target_link_libraries(${EXECUTABLE_NAME} PRIVATE
${CMAKE_CURRENT_LIST_DIR}/linux/libgamematrix.a
${CMAKE_CURRENT_LIST_DIR}/linux/libraylib.a ${CMAKE_CURRENT_LIST_DIR}/linux/libraylib.a
GL X11 m GL
X11
m
pthread
dl
) )
endif()
target_link_libraries(tests PRIVATE
m
)
endif ()
Binary file not shown.
-44
View File
@@ -1,44 +0,0 @@
@@ -1,43 +0,0 @@
========================================================
Projekt: gamematrix (C++ Library)
Rolle: Tester
Datei: tests.txt
Datum: 4.10.2025
Team: prog3b_652
========================================================
# ----------------------------
# 1. Testplan Übersicht
# ----------------------------
Ziel: Überprüfung der Funktionen matmul(), translate(), rot3D().
| Funktion | Testfall | Eingabe | Erwartetes Ergebnis | Bemerkung |
|---------------|---------------------------|------------------------------|-----------------------------------|----------------------------|
| matmul | Identity * Identity | 4x4 Identity Matrizen | Identity | Basisfall |
| matmul | Beispielmatrizen | A=[[...]], B=[[...]] | C=[[...]] | Prüfen mit Handrechnung |
| translate | Verschiebung | Vec3 {1,2,3} | Matrix mit Translation 1,2,3 | Prüfen letzte Spalte |
| rot3D | Rotation Z 90° | angle_deg=90, axis='z' | (1,0,0) -> (0,1,0) | Prüfen Anwendung auf Vektor|
| rot3D | Rotation X 180° | angle_deg=180, axis='x' | (0,1,0) -> (0,-1,0) | Prüfen Anwendung auf Vektor|
| rot3D | Rotation Y 270° | angle_deg=270, axis='y' | (1,0,0) -> (0,0,-1) | Prüfen Anwendung auf Vektor|
# ----------------------------
# 2. Testdaten / Matrizen
# ----------------------------
- Matrizen für matmul: Identity, Beispiel A/B Matrizen
- Vektoren für translate: Vec3 {x, y, z}
- Vektoren für rot3D: Vec3 {1,0,0}, Vec3 {0,1,0}
# ----------------------------
# 3. Abnahmekriterien
# ----------------------------
- Alle Unit-Tests erfolgreich
- Keine Exceptions außer gewollt (z. B. ungültige Achse)
- Testbericht in tests.txt dokumentiert
========================================================
Hinweis:
- Diese Datei wird vom Tester gepflegt.
- Tester dokumentiert Input, Output, erwartetes Ergebnis und Erfolg/Fehler.
========================================================
BIN
View File
Binary file not shown.
-24
View File
@@ -1,24 +0,0 @@
Download
git Clone (link)
Download-Ordner
cd (/Pfad)
pull = ziehen/ abgleichen
Upload
git Clone (link)
git pull
fix:
(cd prog3b_652
git Status
git pull)
git Status
git add
*= alles / Dateiname sonst
+77
View File
@@ -0,0 +1,77 @@
//Ablage für ChatGPT Sachen, nicht relavant für das Projekt (Nur ein "Cloud"-Zwischenspeicher)
#include <iostream>
#include <array>
#include <string>
#include <cmath>
// Typalias für 4x4-Matrix mit double
#include "gamematrix.h"
// Matrixmultiplikation
// Rotationsmatrix um Achse x/y/z
static std::array<std::array<double,4>,4> rot3D(double angle_deg, char axis);
// Verschiebung
static std::array<std::array<double,4>,4> translate(const std::array<double, 3>& pos);
//Matrixmultiplikation-Funktion
std::array<std::array<double,4>,4> gameMatrix::matmul(
const std::array<std::array<double,4>,4>& A,
const std::array<std::array<double,4>,4>& B)
{ //Matrix-Mathematik (Matrix C = A*B)
std::array<std::array<double,4>,4> C{};
for (int i = 0; i < 4; ++i)
for (int j = 0; j < 4; ++j)
for (int k = 0; k < 4; ++k)
C[i][j] += A[i][k] * B[k][j];
return C;
}
// -------------------- Translationsmatrix --------------------
std::array<std::array<double,4>,4> gameMatrix::translate(const std::array<double,3>& pos) {
std::array<std::array<double,4>,4> T{};
for (int i = 0; i < 4; ++i)
T[i][i] = 1.0; // Identitätsmatrix
T[0][3] = pos[0]; // x-Verschiebung
T[1][3] = pos[1]; // y-Verschiebung
T[2][3] = pos[2]; // z-Verschiebung
return T;
}
int main()
{
// Beispiel: Translation testen
std::array<double,3> pos;
std::cout << "Gib die Translation (x y z) ein: ";
std::cin >> pos[0] >> pos[1] >> pos[2];
std::array<std::array<double,4>,4> T = gameMatrix::translate(pos);
std::cout << "\nTranslationsmatrix T:\n";
for (int i = 0; i < 4; ++i) {
for (int j = 0; j < 4; ++j)
std::cout << T[i][j] << "\t";
std::cout << "\n";
}
}
+2 -1
View File
@@ -31,4 +31,5 @@ private:
bool flippingForward = false; bool flippingForward = false;
bool flippingBackward = false; bool flippingBackward = false;
float rotation = 0.0f; float rotation = 0.0f;
}; };
+21 -5
View File
@@ -8,12 +8,28 @@ class gameMatrix
{ {
public: public:
// Matrix Multiplikation // Matrix Multiplikation
static std::array<std::array<double,4>,4> matmul(const std::array<std::array<double,4>,4>& A, static std::array<std::array<double,4>,4> matmul(
const std::array<std::array<double,4>,4>& B); const std::array<std::array<double,4>,4>& A,
const std::array<std::array<double,4>,4>& B
);
// Rotationsmatrix um Achse x/y/z // Rotationsmatrix um Achse x/y/z
static std::array<std::array<double,4>,4> rot3D(double angle_deg, char axis); static std::array<std::array<double,4>,4> rot3D(
double angle_deg,
char axis
);
// Verschiebung // Translation
static std::array<std::array<double,4>,4> translate(const std::array<double, 3>& pos); static std::array<std::array<double,4>,4> translate(
const std::array<double,3>& pos
);
}; };
enum class GameState
{
Idle, // kein Würfel offen, Eingabe erlaubt
OneFlipped, // ein Würfel offen
CheckingMatch, // zwei Würfel vollständig aufgeklappt, Vergleich läuft
LockInput // Würfel drehen gerade – Eingabe kurz blockiert
};
+5 -8
View File
@@ -2,16 +2,13 @@
// Created by kris- on 03.11.2025. // Created by kris- on 03.11.2025.
// //
#include <iostream> #include <iostream>
#include "gamematrix.h" #include "../includes/gamematrix.h"
// Matrixmultiplikation // Matrixmultiplikation
// Rotationsmatrix um Achse x/y/z // Rotationsmatrix um Achse x/y/z
static std::array<std::array<double,4>,4> rot3D(double angle_deg, char axis); //static std::array<std::array<double,4>,4> rot3D(double angle_deg, char axis);
// Verschiebung // Verschiebung
static std::array<std::array<double,4>,4> translate(const std::array<double, 3>& pos); //static std::array<std::array<double,4>,4> translate(const std::array<double, 3>& pos);
@@ -143,8 +140,8 @@ std::array<std::array<double,4>,4> gameMatrix::translate(const std::array<double
} }
return 0; return 0;
} }*/
*/
+132 -32
View File
@@ -1,12 +1,82 @@
#include "gamecube.h" #include "gamecube.h"
#include <algorithm> #include <algorithm>
#include <ctime> #include <ctime>
#include <iostream>
//enum game
//Ab Zeile 114 if game won
//Ab Zeile 148 checking match?
// -----------------------------------------------------------
// Initialisierung
// -----------------------------------------------------------
void innitGame(int pairCount,
std::vector<gamecube> &cubes,
std::vector<Vec3> &positions )
{
cubes.clear();
positions.clear();
// Spielfeld grob quadratisch machen
int total = pairCount * 2;
int cols = ceil(sqrt(total));
int rows = (total + cols - 1) / cols;
float spacing = 2.2f;
// Dynamische Positionen erzeugen
for (int r = 0; r < rows; r++)
{
for (int c = 0; c < cols; c++)
{
if ((int)positions.size() < total)
{
positions.push_back({
(c - cols/2.0f) * spacing,
0,
(r - rows/2.0f) * spacing
});
}
}
}
// Colors erzeugen
std::vector<Color> colorPool;
colorPool.reserve(total);
for (int i = 0; i < pairCount; i++)
{
Color col = {
(unsigned char)(rand() % 256),
(unsigned char)(rand() % 256),
(unsigned char)(rand() % 256),
255
};
colorPool.push_back(col);
colorPool.push_back(col); // Paar
}
// Shuffle
for (int i = total - 1; i > 0; --i)
std::swap(colorPool[i], colorPool[rand() % (i + 1)]);
// Würfel erstellen
for (int i = 0; i < total; i++)
cubes.emplace_back(positions[i], colorPool[i]);
}
// ----------------------------------------------------------- // -----------------------------------------------------------
// 3D Memory Game – Hauptprogramm // 3D Memory Game – Hauptprogramm
// ----------------------------------------------------------- // -----------------------------------------------------------
int main() int main()
{ {
//NEU Counter
int counter = 0;
// Zufall initialisieren // Zufall initialisieren
srand(time(NULL)); srand(time(NULL));
@@ -21,55 +91,74 @@ int main()
camera.fovy = 45.0f; camera.fovy = 45.0f;
camera.projection = CAMERA_PERSPECTIVE; camera.projection = CAMERA_PERSPECTIVE;
// -------------------------------------------------------
// Spielvariablen
// -------------------------------------------------------
// Nur 3 Farben für 3 Paare // Nur 3 Farben für 3 Paare
Color colors[] = { RED, GREEN, BLUE }; int pairCount = 2; // <-- vorerst fixe Anzahl
std::vector<Vec3> positions;
std::vector<gamecube> cubes;
// 6 Karten-Positionen im 3x2 Raster innitGame(pairCount, cubes, positions);
std::vector<Vec3> positions = {{-2, 0, -2}, {0, 0, -2}, {2, 0, -2},{-2, 0, 0}, {0, 0, 0}, {2, 0, 0}};
// Farben doppelt in einen Pool legen und mischen
std::vector<Color> colorPool;
for (int i = 0; i < 3; i++)
{
colorPool.push_back(colors[i]);
colorPool.push_back(colors[i]);
}
// Fisher-Yates Shuffle mit rand()
for (int i = colorPool.size() - 1; i > 0; --i)
{
int j = rand() % (i + 1); // Zufallsindex von 0 bis i
std::swap(colorPool[i], colorPool[j]);
}
// Karten/Würfel erstellen // Karten/Würfel erstellen
std::vector<gamecube> cubes;
for (int i = 0; i < 6; i++)
cubes.emplace_back(positions[i], colorPool[i]);
gamecube* first = nullptr; gamecube* first = nullptr;
gamecube* second = nullptr; gamecube* second = nullptr;
float flipSpeed = 5.0f; // Drehgeschwindigkeit float flipSpeed = 5.0f; // Drehgeschwindigkeit
bool gameWon = false; bool gameWon = false;
GameState state = GameState::Idle; //legen wir fest, in welchem Zustand das Spiel startet
// ----------------------------------------------------------- // -----------------------------------------------------------
// Hauptspielschleife // Hauptspielschleife
// ----------------------------------------------------------- // -----------------------------------------------------------
while (!WindowShouldClose()) while (!WindowShouldClose())
{ {
// Klick-Erkennung // Klick-Erkennung
if (!gameWon && IsMouseButtonPressed(MOUSE_LEFT_BUTTON)) if (!gameWon
{ && (state == GameState::Idle || state == GameState::OneFlipped)
&& IsMouseButtonPressed(MOUSE_LEFT_BUTTON)) {
// nur im Idle- oder OneFlipped-Zustand wird reagiert<-------------------------------------------------
//Wenn einer Dreht, clicken blockieren
// ...
Vector2 mouse = GetMousePosition(); Vector2 mouse = GetMousePosition();
for (auto &c : cubes) for (auto &c : cubes) //Hier die State Logik
{ {
if (!c.IsFlipped() && !c.IsMatched()) std::cout<<("State missing");
if (!c.IsFlipped() && !c.IsMatched()) //<--------------- Zustandwechsel anpassen
{ {
Vector2 screenPos = GetWorldToScreen({c.GetPosition().x, c.GetPosition().y, c.GetPosition().z}, camera);
if (fabs(mouse.x - screenPos.x) < 40 && fabs(mouse.y - screenPos.y) < 40) Vector2 screenPos = GetWorldToScreen(
c.FlipForward(); {c.GetPosition().x, c.GetPosition().y, c.GetPosition().z}, camera);
if (fabs(mouse.x - screenPos.x) < 40 &&
fabs(mouse.y - screenPos.y) < 40)
{
c.FlipForward(); //<-----Animation Start
counter++;
if (state == GameState::Idle) //neu Ü4
{
state = GameState::OneFlipped;
}
else if (state == GameState::OneFlipped && first && &c != first)
{
state = GameState::LockInput;
}
break; // 🔒 nur EIN Würfel pro Klick
}
} }
} }
} }
@@ -82,18 +171,24 @@ int main()
// Sobald ein Würfel vollständig umgedreht ist → merken // Sobald ein Würfel vollständig umgedreht ist → merken
if (c.IsFlipped() && !c.IsMatched()) if (c.IsFlipped() && !c.IsMatched())
{ {
if (!first) first = &c; if (!first)
else if (!second && &c != first) second = &c; first = &c;
else if (!second && &c != first)
second = &c;
} }
} }
// Matching-Logik // Matching-Logik
if (first && second) if (first && second)
{ {
//counter hier macht umdrehungen
Color col1 = first->GetColor(); Color col1 = first->GetColor();
Color col2 = second->GetColor(); Color col2 = second->GetColor();
if (col1.r == col2.r && col1.g == col2.g && col1.b == col2.b) if (col1.r == col2.r &&
col1.g == col2.g &&
col1.b == col2.b)
{ {
first->SetMatched(true); first->SetMatched(true);
second->SetMatched(true); second->SetMatched(true);
@@ -104,10 +199,14 @@ int main()
second->FlipBackward(); second->FlipBackward();
} }
first = second = nullptr; first = second = nullptr;
state = GameState::Idle; //neu
} }
// Gewinnprüfung // -----------------------------
// WIN CHECK
// -----------------------------
if (!gameWon) if (!gameWon)
gameWon = std::all_of(cubes.begin(), cubes.end(), [](const gamecube &c){ return c.IsMatched(); }); gameWon = std::all_of(cubes.begin(), cubes.end(), [](const gamecube &c){ return c.IsMatched(); });
@@ -122,15 +221,16 @@ int main()
c.Draw(); c.Draw();
EndMode3D(); EndMode3D();
if (gameWon) if (gameWon)
DrawText("Congrats! You found all pairs!", 150, 260, 30, DARKBLUE); DrawText("Congrats! You found all pairs!", 150, 260, 30, DARKBLUE);
else else
DrawText("Flip 2 cubes - find matching pairs!", 10, 10, 20, DARKGRAY); DrawText("Flip 2 cubes - find matching pairs!", 10, 10, 20, DARKGRAY);
//Neu Counter
DrawText(TextFormat("Counter: %i",counter/2),10,40,20,DARKGRAY); //counter//2 da sonst doppelt
EndDrawing(); EndDrawing();
} }
CloseWindow(); CloseWindow();
return 0; return 0;
} }
+211
View File
@@ -0,0 +1,211 @@
//
// Created by gamer on 14.12.2025.
//
#include "gamecube.h"
#include <algorithm>
#include <ctime>
#include <iostream>
// -----------------------------------------------------------
// GameState – Zustandsmaschine
// -----------------------------------------------------------
enum class GameState
{
Idle, // kein Würfel offen
OneFlipped, // ein Würfel offen
LockInput, // Animation läuft
CheckingMatch // Vergleich
};
// -----------------------------------------------------------
// Initialisierung
// -----------------------------------------------------------
void innitGame(int pairCount,
std::vector<gamecube> &cubes,
std::vector<Vec3> &positions)
{
cubes.clear();
positions.clear();
int total = pairCount * 2;
int cols = ceil(sqrt(total));
int rows = (total + cols - 1) / cols;
float spacing = 2.2f;
for (int r = 0; r < rows; r++)
for (int c = 0; c < cols; c++)
if ((int)positions.size() < total)
positions.push_back({
(c - cols / 2.0f) * spacing,
0,
(r - rows / 2.0f) * spacing
});
std::vector<Color> colorPool;
for (int i = 0; i < pairCount; i++)
{
Color col = {
(unsigned char)(rand() % 256),
(unsigned char)(rand() % 256),
(unsigned char)(rand() % 256),
255
};
colorPool.push_back(col);
colorPool.push_back(col);
}
for (int i = total - 1; i > 0; --i)
std::swap(colorPool[i], colorPool[rand() % (i + 1)]);
for (int i = 0; i < total; i++)
cubes.emplace_back(positions[i], colorPool[i]);
}
// -----------------------------------------------------------
// MAIN
// -----------------------------------------------------------
int main()
{
srand(time(NULL));
InitWindow(800, 600, "3D Memory Game – Stable Version");
SetTargetFPS(60);
Camera3D camera{};
camera.position = {6, 6, 6};
camera.target = {0, 0, 0};
camera.up = {0, 1, 0};
camera.fovy = 45;
camera.projection = CAMERA_PERSPECTIVE;
int pairCount = 2;
std::vector<Vec3> positions;
std::vector<gamecube> cubes;
innitGame(pairCount, cubes, positions);
gamecube *first = nullptr;
gamecube *second = nullptr;
float flipSpeed = 5.0f;
bool gameWon = false;
int counter = 0;
GameState state = GameState::Idle;
// -----------------------------------------------------------
// GAME LOOP
// -----------------------------------------------------------
while (!WindowShouldClose())
{
// -----------------------------
// INPUT (nur wenn erlaubt)
// -----------------------------
if (!gameWon &&
(state == GameState::Idle || state == GameState::OneFlipped) &&
IsMouseButtonPressed(MOUSE_LEFT_BUTTON))
{
Vector2 mouse = GetMousePosition();
for (auto &c : cubes)
{
if (!c.IsFlipped() && !c.IsMatched())
{
Vector2 screenPos = GetWorldToScreen(
{c.GetPosition().x, c.GetPosition().y, c.GetPosition().z},
camera);
if (fabs(mouse.x - screenPos.x) < 40 &&
fabs(mouse.y - screenPos.y) < 40)
{
c.FlipForward();
counter++;
if (state == GameState::Idle)
state = GameState::OneFlipped;
else
state = GameState::LockInput;
break; // 🔒 nur EIN Würfel pro Klick
}
}
}
}
// -----------------------------
// UPDATE – Animation
// -----------------------------
for (auto &c : cubes)
{
c.Update(flipSpeed);
if (c.IsFlipped() && !c.IsMatched())
{
if (!first)
first = &c;
else if (!second && &c != first)
second = &c;
}
}
// -----------------------------
// Animation beendet → Vergleich
// -----------------------------
if (state == GameState::LockInput && first && second)
state = GameState::CheckingMatch;
// -----------------------------
// MATCHING
// -----------------------------
if (state == GameState::CheckingMatch)
{
Color a = first->GetColor();
Color b = second->GetColor();
if (a.r == b.r && a.g == b.g && a.b == b.b)
{
first->SetMatched(true);
second->SetMatched(true);
}
else
{
first->FlipBackward();
second->FlipBackward();
}
first = second = nullptr;
state = GameState::Idle;
}
// -----------------------------
// WIN CHECK
// -----------------------------
if (!gameWon)
gameWon = std::all_of(
cubes.begin(),
cubes.end(),
[](const gamecube &c)
{ return c.IsMatched(); });
// -----------------------------
// DRAW
// -----------------------------
BeginDrawing();
ClearBackground(RAYWHITE);
BeginMode3D(camera);
for (auto &c : cubes)
c.Draw();
EndMode3D();
if (gameWon)
DrawText("Congrats! You found all pairs!", 140, 260, 30, DARKBLUE);
else
DrawText("Flip 2 cubes - find matching pairs!", 10, 10, 20, DARKGRAY);
DrawText(TextFormat("Moves: %i", counter / 2), 10, 40, 20, DARKGRAY);
EndDrawing();
}
CloseWindow();
return 0;
}
+163
View File
@@ -0,0 +1,163 @@
#include "gamecube.h"
#include <algorithm>
#include <ctime>
//Funktion innitGame
//Anzahl der Paare(pairCount*2)
void innitGame()
{
}
// -----------------------------------------------------------
// 3D Memory Game – Hauptprogramm
// -----------------------------------------------------------
int main()
{
//NEU Counter
int counter = 0;
// Zufall initialisieren
srand(time(NULL));
// Fenster und Kamera
InitWindow(800, 600, "3D Memory Game with Matrix3D Library");
SetTargetFPS(60);
Camera3D camera{};
camera.position = {6.0f, 6.0f, 6.0f};
camera.target = {0.0f, 0.0f, 0.0f};
camera.up = {0.0f, 1.0f, 0.0f};
camera.fovy = 45.0f;
camera.projection = CAMERA_PERSPECTIVE;
// Nur 3 Farben für 3 Paare <----------------------------------------------------------
Color colors[] = { RED, GREEN, BLUE };
// 6 Karten-Positionen im 3x2 Raster
std::vector<Vec3> positions = {{-2, 0, -2}, {0, 0, -2}, {2, 0, -2},{-2, 0, 0}, {0, 0, 0}, {2, 0, 0}};
// Farben doppelt in einen Pool legen und mischen
std::vector<Color> colorPool;
for (int i = 0; i < 3; i++)
{
colorPool.push_back(colors[i]);
colorPool.push_back(colors[i]);
}
// Fisher-Yates Shuffle mit rand()
for (int i = colorPool.size() - 1; i > 0; --i)
{
int j = rand() % (i + 1); // Zufallsindex von 0 bis i
std::swap(colorPool[i], colorPool[j]);
}
// Karten/Würfel erstellen
std::vector<gamecube> cubes;
for (int i = 0; i < 6; i++)
cubes.emplace_back(positions[i], colorPool[i]); //<------------------------------------------------------------
gamecube* first = nullptr;
gamecube* second = nullptr;
float flipSpeed = 5.0f; // Drehgeschwindigkeit
bool gameWon = false;
// -----------------------------------------------------------
// Hauptspielschleife
// -----------------------------------------------------------
while (!WindowShouldClose())
{
// Klick-Erkennung
if (!gameWon && IsMouseButtonPressed(MOUSE_LEFT_BUTTON))
{
//Neu Counter
counter++;
Vector2 mouse = GetMousePosition();
for (auto &c : cubes)
{
if (!c.IsFlipped() && !c.IsMatched())
{
Vector2 screenPos = GetWorldToScreen({c.GetPosition().x, c.GetPosition().y, c.GetPosition().z}, camera);
if (fabs(mouse.x - screenPos.x) < 40 && fabs(mouse.y - screenPos.y) < 40)
c.FlipForward();
}
}
}
// Animation aller Würfel
for (auto &c : cubes)
{
c.Update(flipSpeed);
// Sobald ein Würfel vollständig umgedreht ist → merken
if (c.IsFlipped() && !c.IsMatched())
{
if (!first) first = &c;
else if (!second && &c != first) second = &c;
}
}
// Matching-Logik
if (first && second)
{
//counter hier macht umdrehungen
Color col1 = first->GetColor();
Color col2 = second->GetColor();
if (col1.r == col2.r && col1.g == col2.g && col1.b == col2.b)
{
first->SetMatched(true);
second->SetMatched(true);
}
else
{
first->FlipBackward();
second->FlipBackward();
}
first = second = nullptr;
}
// Gewinnprüfung
if (!gameWon)
gameWon = std::all_of(cubes.begin(), cubes.end(), [](const gamecube &c){ return c.IsMatched(); });
// -----------------------------------------------------------
// Zeichnen
// -----------------------------------------------------------
BeginDrawing();
ClearBackground(RAYWHITE);
BeginMode3D(camera);
for (auto &c : cubes)
c.Draw();
EndMode3D();
if (gameWon)
DrawText("Congrats! You found all pairs!", 150, 260, 30, DARKBLUE);
else
DrawText("Flip 2 cubes - find matching pairs!", 10, 10, 20, DARKGRAY);
//Neu Counter
DrawText(TextFormat("Counter: %i",counter/2),10,40,20,DARKGRAY); //counter//2 da sonst doppelt
EndDrawing();
}
CloseWindow();
return 0;
}
-1
View File
@@ -1 +0,0 @@
git push pull test
Binary file not shown.