The Four Numbers Game is a mathematical game, as taught by Dr. Paul Sally, Prof. of Mathematics at the University of Chicago. To play this game, draw a square and put a number at each corner, thus:
5___9
| |
| |
| |
7___13
Now form a new square based on the difference between each the values at the ends of each side. Example:
5_4_9
| |
2 4
| |
7_6_13
This gives a new square, which I'll rotate anticlockwise 45 degrees.
4___4
| |
| |
| |
2___6
This in turn gives
0___2
| |
| |
| |
2___4
Then
2___2
| |
| |
| |
2___2
Then
0___0
| |
| |
| |
0___0
At this point, the game is over.
Codes for geting any four given numbers:
-
SubFourNumbers(ByRefstepsAsString,ByRefcountAsLong,ParamArrays())
-
DimtempAsString,tempcountAsLong
- count=1
-
Ifs(0)&s(1)&s(2)&s(3)="0000"Thensteps=Join(s,","):ExitSub
- FourNumberstemp,tempcount,Abs(s(0)-s(1)),Abs(s(1)-s(2)),Abs(s(2)-s(3)),Abs(s(3)-s(0))
-
steps=Join(s,",")&vbCrLf&temp
- count=tempcount+1
-
EndSub
-
SubGetit()
-
DimstepsAsString,countAsLong
- FourNumberssteps,count,[exp(1)],[pi()],1,0
- Debug.Print "Count=" & count & vbCrLf & String(50, "-") & vbCrLf & steps
- FourNumbers steps, count, 149, 274, 504, 927
- Debug.Print "Count=" & count & vbCrLf & String(50, "-") & vbCrLf & steps
-
EndSub
It returns:
Count=5
--------------------------------------------------
2.71828182845905,3.14159265358979,1,0
0.423310825130748,2.14159265358979,1,2.71828182845905
1.71828182845905,1.14159265358979,1.71828182845905,2.2949710033283
0.576689174869252,0.576689174869252,0.576689174869252,0.576689174869252
0,0,0,0
Count=19
--------------------------------------------------
149,274,504,927
125,230,423,778
105,193,355,653
88,162,298,548
74,136,250,460
62,114,210,386
52,96,176,324
44,80,148,272
36,68,124,228
32,56,104,192
24,48,88,160
24,40,72,136
16,32,64,112
16,32,48,96
16,16,48,80
0,32,32,64
32,0,32,64
32,32,32,32
0,0,0,0
分享到:
相关推荐
End systems include PCs, workstations, Web servers, mail servers, PDAs, Internet-connected game consoles, etc. From Wikipedia: Diplomatic protocol is commonly described as a set of international ...
(b) the name of the table, the names of the table's attributes, the data types of the table's attributes, the formats of the table's attributes, and the maximum number of rows that the table can have...
2. Building the Core Game Framework 9 2.1 Controllers and Managers............................................11 2.1.1 Controllers................................................11 2.1.2 Managers........
After providing a background introduction, the paper delves into four key algorithms employed in intelligent Gobang: Neural Network Reinforcement Learning Algorithm, Game Tree Algorithm, Minimax ...
The snake can change the course of action the mouse, the mouse is when they eat it, which they physical or risk death and the end of four games. Music can have five. May to file operations ...
The 80x86 MOV Instruction 4.8 - Some Final Comments on the MOV Instructions <br>4.9 Laboratory Exercises 4.9.1 The UCR Standard Library for 80x86 Assembly Language Programmers 4.9.2 ...
the hit songs from that year and display the artist, song, number of weeks on the charts, etc. Write the user’s year choice to a file so that you can keep track of the most requested years. - Ask the...
A real world example would be game programming: you only have to change the script(s) and you can create a whole new game using the same engine. LUA is fully customizable, you can create your own ...
2.4 The Four Fundamental Subspaces 115 2.5 Graphs and Networks 129 2.6 Linear Transformations 140 2.7 Review Exercises 154 3 Orthogonality 159 3.1 Orthogonal Vectors and Subspaces 159 3.2 Cosines and ...
We'll embark our journey by dividing the learning path into four modules. Each of these modules are a mini course in their own right; and as you complete each one, you'll gain key skills and be ready...
There are four file :1) the fuctoriel function 2)the game tic tac toe 3)the game number guess 4) the histogram program
1408 The Fun Number System 简单题 1486 Color the Tree 简单题 1487 Playing Cards 简单题 1489 2^x mod n = 1 简单题,应该有好算法,不过枚举就可以过…… 1503 One Person "The Price is Right" 简单题,...
1408 The Fun Number System 简单题 1486 Color the Tree 简单题 1487 Playing Cards 简单题 1489 2^x mod n = 1 简单题,应该有好算法,不过枚举就可以过…… 1503 One Person "The Price is Right" 简单题,...
)回答示例:I’m in Class One, Grade Four.(我在四年一班。) - 询问编号:What’s your number?(你的号码是多少?)回答示例:I’m number thirteen.(我是十三号。) - 排队指令:Line up.(排队。) - 基本...
(将GraderRunner.java和GamesStatistics.java添加到项目中,并在Connect4Game中更改了某些访问修饰符。) 使用说明 将学生的MyAgent.java文件复制到src/main/java目录。 在命令行上运行./gradlew 。 (Windows...
33. four - 四(number) 34. five - 五(number) 35. six - 六(number) 36. seven - 七(number) 37. eight - 八(number) 38. nine - 九(number) 39. telephone - 电话(noun) 40. number - 数;数字...
column = int(input("Player {}, enter column number (1-7): ".format(game.current_player))) if not game.place_chip(column - 1): print("Column is full. Try again.") continue winner = game.check_win...
It's…”的句型,并通过游戏"The number game"复习数字。 2. Presentation and practice:首先教授"What time is it?"。通过大钟模型演示如何提问和回答,然后让学生进行对练。接着,讲解时间的不同表达方式,如1:...
where L is the desired drive letter A to Z will re enable the drive The small CC COM "Clear Cache" program can help verify files written by UIDE Entering CC at the DOS command prompt ...
1. 作为名词,意为“特色菜、特价品”,如“The train is a special for the football game”。 2. 作为形容词,表示“特殊的”,如“He has a special accent”。 五、order的用法 1. 作为名词,意为“点菜”,如...