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)dL1NY%s>U{4l;X9A2>Qa1lneQOr4@ha9nJyT%kPLN;3T{vdxb&gY|
z_x#xPp>o7GG`8o&67iJM$DwLc0h1XJ2!X74YHXozBf%Ua)$>fyG?j)!cLb1H|1{dx
z9+n><+u`PLaUZ<4&$i;rM8_|mxQEXS)
zfatu$I#*ge5L?IhJhFlCINL2FpGiUM03D%7hvPo%0P2Npug7#+>mF_HGg
zsItCouC=!F9LB
z;@ac`{#DC3`oIjU{D3@5)DAz)%rZ{v8d`mR*uIkR^k|1rQzJsTe&oyxovevxHu*TJ
qx!5)+AnOr~bjO9K9#7yb_mJ<;|6
literal 0
HcmV?d00001
diff --git a/app/src/main/res/values-night/colors.xml b/app/src/main/res/values-night/colors.xml
new file mode 100644
index 0000000..b1a4bec
--- /dev/null
+++ b/app/src/main/res/values-night/colors.xml
@@ -0,0 +1,5 @@
+
+
+ #f9f6f2
+ #49403C
+
\ No newline at end of file
diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml
new file mode 100644
index 0000000..573e75c
--- /dev/null
+++ b/app/src/main/res/values-zh-rCN/strings.xml
@@ -0,0 +1,31 @@
+
+
+ \n常规游戏设置\n
+ 横向方块数
+ 纵向方块数
+ 初始数字数量
+ 生成数字数量
+ 生成2的概率(%)
+ \nAI设置(4x4网格专属)\n
+ 思考最短间隔(毫秒)
+ 思考最深层数(可填0)
+ \nAI设置(非4x4网格专属)\n
+ AI最大数字权重
+ AI平滑系数权重
+ AI单调系数权重
+ AI空格数量权重
+ AI是否考虑生成4的情况
+ 返回
+ 保存
+ \n设置项的默认值可以在没有填入任何数字时看到。\n\n在4x4的网格上,游戏会使用实验性的全新AI算法。新AI可调节的设置项目前只有两个:思考最短间隔、思考最深层数。\n在其他大小(如3x3,5x5)的网格上,游戏依然使用旧版本的AI。您可以调节旧AI的五个设置项。\n\n各个设置项的详细解释:\n\n1.思考最短间隔:设定4x4 AI每次思考的最少短用时。\n\n2.思考最深层数:可以理解为设定4x4 AI每次思考的最长用时(思考层数越高,用时也越长)。如果填0,AI就会根据当前游戏的形势自主选择每次思考的层数。\n 此设置项直接决定4x4 AI的强度和速度,推荐填0以获得最大强度的AI;推荐填4~8以获得速度稳定的AI。\n\n3.最大数字权重:AI是否倾向于尽力生成一个更大的数字。比如有的时候可以用两个2048合成4096,但如果这个权重调低了,AI就会选择先不合成4096,而是去做他认为更应该做的事(比如想办法让空格子数目增多,从而延长生存时间)。\n\n4.平滑系数权重:平滑是指两个相邻方块的值之间的差别。如果1024在2的旁边,那么他俩的平滑系数就很大(相隔2的9次方,所以需要9次合成才能相同);如果32在32的旁边,那么他俩平滑系数就是零。很明显,越平滑,相邻方块就越容易合并成更大的数字。调大这个系数,AI会倾向于把相近的数字放在一起。\n\n5.单调系数权重:如果某一行是单调递增的,如32 64 128 256,这一行极有可能合成出更大数字。反之如果是非常乱序不单调的,则没有可能合成更大数字。调大这个权重就会看到AI在合成一行又一行的单调数列。\n\n6.空格系数权重:空格的数目多,意味着生存时间变长。这个权重调大后,AI就会尽力保障空格子的数量。\n\n7.AI是否考虑生成4的情况:默认情况下,2048规则是每次移动后有很大概率(90%)新生成一个数字2,很小概率(10%)新生成一个数字4。如果让AI不考虑生成4的情况,那么AI运行速度将加快一倍。\n\n\n\n\n
+ 点击任意位置停止AI
+ 已停止AI
+ 请重新输入
+ 请重新输入AI各项权重值
+ AI相关的设置将立即生效\n游戏相关的设置重启后生效
+ 最高分
+ 分数
+ 成功%s音效,重启游戏生效
+ 开启
+ 关闭
+
\ No newline at end of file
diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml
new file mode 100644
index 0000000..26079d0
--- /dev/null
+++ b/app/src/main/res/values/colors.xml
@@ -0,0 +1,10 @@
+
+
+ #000000
+ #f9f6f2
+ #776e65
+ #d6cdc4
+ #faf8ef
+ #ff8800
+
+
\ No newline at end of file
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
new file mode 100644
index 0000000..34fc40a
--- /dev/null
+++ b/app/src/main/res/values/strings.xml
@@ -0,0 +1,38 @@
+
+
+ \nGeneral Settings\n
+ Grid X Width
+ Grid Y Height
+ Tiles Generated At Start
+ Tiles Generated Per Move
+ Probability of Gen 2(%)
+ \n4x4 Grid AI Settings\n
+ Min Thinking Interval(ms)
+ Max Thinking Depth(can be 0)
+ \nnon-4x4 Grid AI Settings\n
+ AI MaxWeight
+ AI SmoothWeight
+ AI MonoWeight
+ AI EmptyWeight
+ AI Consider Generating 4
+ Back
+ Save
+ \nThe default values of each setting can be seen when no numbers are entered.\n\nOn the 4x4 grid, the game uses an experimental new AI algorithm. There are only two adjustable settings for the new AI: Minimum Thinking Interval and Maximum Thinking Depth.\nOn other grid sizes (such as 3x3 or 5x5), the game still uses the old version of the AI. You can adjust the five settings for the old AI.\n\nThe detailed explanations of each setting are as follows:\n\n
+1.Min Thinking Interval: Sets the minimum time for each thinking process of the 4x4 AI.\n\n
+2.Max Thinking Depth: Can be understood as setting the maximum time for each thinking process of the 4x4 AI (the higher the thinking depth, the longer the time required). If set to 0, the AI will choose the thinking depth based on the current situation of the game. This setting directly determines the strength and speed of the 4x4 AI. It is recommended to set it to 0 to get the maximum strength of the AI, or to set it to 4-8 to get a stable speed.\n\n
+3.MaxWeight: Whether the AI tends to generate a larger number. For example, sometimes two 2048s can be combined to form a 4096, but if this weight is lowered, the AI will choose not to combine them into a 4096, but to do what it thinks is more important (such as trying to increase the number of empty cells and extend the survival time).\n\n
+4.SmoothWeight: Smoothness refers to the difference between the values of two adjacent blocks. If 1024 is next to 2, then their smoothness coefficient is very large (9 times the difference, so it takes 9 combinations to become the same); if 32 is next to 32, then their smoothness coefficient is zero. Obviously, the smoother it is, the easier it is for adjacent blocks to merge into a larger number. Increasing this coefficient will cause the AI to prefer to put similar numbers together.\n\n
+5.MonoWeight: If a row is monotonically increasing, such as 32 64 128 256, it is very likely to produce a larger number. Conversely, if it is very disorderly and non-monotonic, it is impossible to combine larger numbers. Increasing this weight will make the AI merge rows of monotonic sequences.\n\n
+6.EmptyWeight: The more empty cells there are, the longer the survival time. By increasing this weight, the AI will try to ensure the number of empty cells.\n\n
+7.AI consider generating 4: By default, in the 2048 game, there is a high probability (90%) of generating a new number 2 after each move, and a low probability (10%) of generating a new number 4. If the AI does not consider generating 4, its running speed will double.\n\n\n\n
+ Touch Anywhere To Stop AI.
+ AI Stopped.
+ Please Input Again.
+ Please Input AI Weights Again.
+ AI settings take effect immediately.
+ Max Score
+ Score
+ Successfully %s Sound Effect. Please Restart The Game.
+ Open
+ Close
+
\ No newline at end of file
diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml
new file mode 100644
index 0000000..e3c0d39
--- /dev/null
+++ b/app/src/main/res/values/styles.xml
@@ -0,0 +1,31 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/build.gradle b/build.gradle
index 026daed..0114b27 100644
--- a/build.gradle
+++ b/build.gradle
@@ -1,17 +1,5 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
-buildscript {
- repositories {
- google()
- mavenCentral()
- }
- dependencies {
- classpath "com.android.tools.build:gradle:7.0.4"
-
- // NOTE: Do not place your application dependencies here; they belong
- // in the individual module build.gradle files
- }
-}
-
-task clean(type: Delete) {
- delete rootProject.buildDir
+plugins {
+ id 'com.android.application' version '7.4.1' apply false
+ id 'com.android.library' version '7.4.1' apply false
}
\ No newline at end of file
diff --git a/gradle.properties b/gradle.properties
index 52f5917..3e927b1 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -12,8 +12,10 @@ org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
# AndroidX package structure to make it clearer which packages are bundled with the
-# Android operating system, and which are packaged with your app"s APK
+# Android operating system, and which are packaged with your app's APK
# https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true
-# Automatically convert third-party libraries to use AndroidX
-android.enableJetifier=true
\ No newline at end of file
+# Enables namespacing of each library's R class so that its R class includes only the
+# resources declared in the library itself and none from the library's dependencies,
+# thereby reducing the size of the R class for that library
+android.nonTransitiveRClass=true
\ No newline at end of file
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index 92725d7..7ee449f 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
-#Thu May 05 16:35:33 CST 2022
+#Wed Feb 01 22:13:08 CST 2023
distributionBase=GRADLE_USER_HOME
-distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
diff --git a/settings.gradle b/settings.gradle
index d345950..bf76cbd 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -1,10 +1,16 @@
+pluginManagement {
+ repositories {
+ google()
+ mavenCentral()
+ gradlePluginPortal()
+ }
+}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
- jcenter() // Warning: this repository is going to shut down soon
}
}
-rootProject.name = "2048"
+rootProject.name = "2048 AI"
include ':app'