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
分享到:
相关推荐
want in your game programming toolbox, like a good random number generator. It also introduces the major components of games and how they interact. After you read the chapters in this part, you‘ll ...
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........
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 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 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 ...
After you hear a question, you must choose the best answer from the four choices marked A),B),C) and D).Then mark the corresponding letter on the Answer Sheet with a single line through the centre....
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" 简单题,...
(将GraderRunner.java和GamesStatistics.java添加到项目中,并在Connect4Game中更改了某些访问修饰符。) 使用说明 将学生的MyAgent.java文件复制到src/main/java目录。 在命令行上运行./gradlew 。 (Windows...
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 ...
The number of questions is increasing recently. Here is the classification of all `468` questions. For more questions and solutions, you can see my [LintCode](https://github.com/kamyu104/LintCode) ...
Game Loops and Game States ................................................................................................... 10 pygame.event.Event Objects ..............................................
│ │ GameEngine.lib │ │ GameEngineD.lib │ │ GameFrame.lib │ │ GameFrameD.lib │ │ GameProperty.lib │ │ GamePropertyD.lib │ │ GameService.lib │ │ GameServiceD.lib │ │ KernelEngine.lib ...
four f【手】,o【一个】,u【无意】,r【卷】→五个手指,卷曲一个,剩下四个 five f【手】,v【像向外伸出的形状-伸出的五个手指,罗马数字就是用v表示五的】→手上的五个手指都伸出来 six s【s最初的形状像...