first commit

This commit is contained in:
lzh
2024-05-11 23:36:37 +08:00
commit 0d0e19670d
28 changed files with 1803 additions and 0 deletions
+38
View File
@@ -0,0 +1,38 @@
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/
### IntelliJ IDEA ###
.idea/modules.xml
.idea/jarRepositories.xml
.idea/compiler.xml
.idea/libraries/
*.iws
*.iml
*.ipr
### Eclipse ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/
### VS Code ###
.vscode/
### Mac OS ###
.DS_Store
+8
View File
@@ -0,0 +1,8 @@
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml
+7
View File
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding">
<file url="file://$PROJECT_DIR$/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/src/main/resources" charset="UTF-8" />
</component>
</project>
+14
View File
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="MavenProjectsManager">
<option name="originalFiles">
<list>
<option value="$PROJECT_DIR$/pom.xml" />
</list>
</option>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_19" default="true" project-jdk-name="19" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>
+162
View File
@@ -0,0 +1,162 @@
@startuml
class org.example.NumberleCLI {
- {static} String ANSI_RESET
- {static} String ANSI_GREEN
- {static} String ANSI_YELLOW
- {static} String ANSI_GRAY
- {static} INumberleModel model
- {static} Scanner scanner
+ {static} void main(String[])
- {static} boolean validateExpression(String)
- {static} void playGame()
- {static} void printCategories()
- {static} String getInput()
- {static} void printGameStatus()
- {static} void printColoredInput(String,String)
}
class org.example.NumberleModel {
- String TargetWord
+ ArrayList<String> NumberList
+ int remainAttempts
+ boolean gamewon
+ boolean Flag1
+ boolean Flag2
+ boolean Flag3
+ String DefaultNumberal
- StringBuilder CurrentGuess
+ void initialize()
+ boolean ProcessInput(String)
+ void remove()
+ void LoadList()
+ boolean processInput(String)
+ boolean isGameOver()
+ boolean isGameWon()
+ void setFlag(boolean)
+ void setFlag3(boolean)
+ void setTargetword(String)
+ String getTargetWord()
+ StringBuilder getCurrentGuess()
+ int getRemainingAttempts()
+ void setRemainingAttempts(int)
+ boolean startNewGame()
+ String DefaultWord()
}
class org.example.Main {
+ {static} void main(String[])
+ {static} void createAndShowGUI()
}
class org.example.NumberleController {
- NumberleView view
- INumberleModel model
+ int getRemainingAttempts()
+ void startNewGame()
+ void SetFlag(Boolean)
+ void setflag1(Boolean)
+ void setFlag2(Boolean)
+ void setView(NumberleView)
+ String getTargetWord()
+ void setRemainingAttempts(int)
+ void processInput(String)
+ boolean isGameOver()
+ boolean isGameWon()
+ void setTargetWord()
}
interface org.example.INumberleModel {
~ {static} int MAX_ATTEMPTS
~ void initialize()
~ boolean processInput(String)
~ boolean isGameOver()
~ boolean isGameWon()
~ void setFlag3(boolean)
~ void setFlag(boolean)
~ void setTargetword(String)
~ String getTargetWord()
~ StringBuilder getCurrentGuess()
~ int getRemainingAttempts()
~ void setRemainingAttempts(int)
~ boolean startNewGame()
~ String DefaultWord()
~ void remove()
}
class org.example.Junit {
- NumberleModel model
+ void Setup()
+ void TestNumber()
+ void testProcessInput()
+ void testRemove_EmptyGuess()
+ void testStartNewGame()
+ void testRemainingAttempts()
+ void testProcessInput_InvalidEquation()
+ void testProcessInput_InvalidInput()
}
class org.example.NumberleView {
- JPanel panel
- JLayeredPane layeredPane
- NumberleController controller
- INumberleModel model
+ JButton[][] button
- JTextField inputTextField
- int currentRow
- int CurrentCols
+ {static} int ROWS
+ {static} int COLS
+ {static} int MAX_INPUT_LENGTH
- {static} Color CORRECT_COLOR
- {static} Color INCORRECT_COLOR
- Color defaultColor
- JPanel row1
- JPanel row2
- boolean isDarkTheme
+ void initialize()
+ void Fixed()
+ void Swap()
+ void display()
+ void change()
+ void Input()
+ void Setting()
- void updateButtonsFromTarget(char[],String)
- void updateButtonsFromInput(String)
+ void Enter()
- boolean validateEquation(String)
+ void clearDisplay()
+ void updateDisplay(String)
+ void TooShort()
+ void MultiplyOperator()
+ void Symobol()
+ void HowtoPlayGame()
+ void NotEqual()
- void showGameStartReminder()
+ void NoEqualSign()
+ void Youlost()
+ void Youwon()
+ void update(Observable,Object)
}
class org.example.NumberleView$ButtonClickListener {
+ void actionPerformed(ActionEvent)
}
NumberleController->INumberleModel
NumberleView ->NumberleController
NumberleView ->INumberleModel
NumberleModel->NumberleCLI
org.example.INumberleModel <|.. org.example.NumberleModel
org.example.Observable <|-- org.example.NumberleModel
java.util.Observer <|.. org.example.NumberleView
org.example.JFrame <|-- org.example.NumberleView
org.example.NumberleView +.. org.example.NumberleView$ButtonClickListener
org.example.ActionListener <|.. org.example.NumberleView$ButtonClickListener
@enduml
+37
View File
@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.example</groupId>
<artifactId>wo</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
<maven.compiler.source>19</maven.compiler.source>
<maven.compiler.target>19</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>net.objecthunter</groupId>
<artifactId>exp4j</artifactId>
<version>0.4.8</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.1</version>
<scope>compile</scope>
</dependency>
</dependencies>
</project>
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 123 KiB