HexGame-Pygame

所属分类:游戏
开发工具:Python
文件大小:0KB
下载次数:0
上传日期:2022-03-26 19:08:53
上 传 者sh-1993
说明:  Pygame中的HexGame娱乐。更多功能将很快推出!,
(Recreation of HexGame in Pygame. More features will come soon !,)

文件列表:
Flags/ (0, 2022-03-26)
Flags/fr.png (2934, 2022-03-26)
Flags/gr.png (608, 2022-03-26)
Flags/jp.png (209, 2022-03-26)
Flags/kr.png (32465, 2022-03-26)
Flags/sw.png (1111, 2022-03-26)
Flags/us.png (26240, 2022-03-26)
Fonts/ (0, 2022-03-26)
Fonts/DoHyeon-Regular.ttf (858928, 2022-03-26)
Fonts/MPLUSRounded1c-Medium.ttf (3423528, 2022-03-26)
Icon/ (0, 2022-03-26)
Icon/?.png (35077, 2022-03-26)
Icon/?2.png (13811, 2022-03-26)
Icon/Hex_icon.png (33796, 2022-03-26)
Icon/IA.png (74962, 2022-03-26)
Icon/Image.png (61751, 2022-03-26)
Icon/Image10.png (72928, 2022-03-26)
Icon/Image2.png (1406213, 2022-03-26)
Icon/Image3.png (73555, 2022-03-26)
Icon/Image4.png (73608, 2022-03-26)
Icon/Image5.png (72268, 2022-03-26)
Icon/Image6.png (72322, 2022-03-26)
Icon/Image7.png (75605, 2022-03-26)
Icon/Image8.png (72327, 2022-03-26)
Icon/Image9.png (72314, 2022-03-26)
Icon/WWW.png (43929, 2022-03-26)
Icon/ai.png (15787, 2022-03-26)
Icon/arrow.png (16382, 2022-03-26)
Icon/flags.png (67694, 2022-03-26)
Icon/github.png (20904, 2022-03-26)
Icon/house.png (24143, 2022-03-26)
Icon/local.png (46782, 2022-03-26)
Icon/logo_menu.png (195020, 2022-03-26)
Icon/online.png (72245, 2022-03-26)
Icon/paint.png (14445, 2022-03-26)
LICENSE (35149, 2022-03-26)
Music/ (0, 2022-03-26)
Music/Music.ogg (4645245, 2022-03-26)
Music/button_hover.mp3 (53416, 2022-03-26)
... ...

# Hex with Pygame - [Historical point of view](https://github.com/aderepas/HexGame-Pygame/blob/master/#historical-point-of-view) - [What Are the rules of this game ?](https://github.com/aderepas/HexGame-Pygame/blob/master/#what-are-the-rules-of-this-game--) - [Some Strategies and tips](https://github.com/aderepas/HexGame-Pygame/blob/master/#some-strategies-and-tips) - [The algorithm for the Win](https://github.com/aderepas/HexGame-Pygame/blob/master/#the-algorithm-for-the-win) - [Other fonctionnalities](https://github.com/aderepas/HexGame-Pygame/blob/master/#other-fonctionnalities) ## New In almost 1 year of Programmation, I learned a lot. I will soonly update my code and create an IA for Hex. ## Whats is Hex ? ### Historical point of view ----- Hex as been created in 1942 by a Danish mathematician named _Piet Hein_. The first commercialization of this game is in 1952. With time, some strategies to win have been seeking. Thus, techniques have been found to consistently win on a 7x7 and 9x9 Board. More recently, in 2019, Facebook succeeds in beating the best player of Hex on a 19x19 board. ### What Are the rules of this game ? --- First, Hex is a two player game. It's a strategic and abstract board game. Each players have a color, black and white. The cells of the board are made up of hexagons. Hence the name "Hex".The goal for each player is to form a connected path of their stones linking the opposing sides of the board marked by their colors before their opponent similarly connects his or her sides. _Illustration from the Game_ In this example, white won because they form a line that is linking the opposite white side. Traditionally, board measure 9x9, 11x11, 13x13 or 17x17. ### Some Strategies and tips --- #### **Easy and Faster connections** Usually, beginners place their pawns directly next to them to create a connection. But there is a faster way to proceed. If you have 2 pawns that have 2 hexagons in common (1), they can be connected, even if black put a Hexagon in one of them (2) > (3). Example: #### **Stopping a pawn** Imagine playing black and being in this situation: --- How can you stop white ? First play a pawn in front of white's pawn. --- Now white is obligate to play at the left if they want to win. ---- Now that you are in this position you must put white in a situation where they must play near your pion, by playing like that: --- Now white as no option: --- Last be not the least, play a pawn like the first time --- And that's it ! You blocked them. ## The program ### The algorithm for the Win --- How can the algorithm detect if a player has won ? #### **Step 1:** If there is a pawn on the first line, it would be marked as "solution pawn". If there is no pawn on this line, then, the player can't win #### **Step 2:** All pawns connected to a solution Pawn becomes Solution pawn. But when a Solution Pawn makes a non-solution pawn to become a solution, then this pawn becomes "past". A past pawn can't be a solution pawn anymore. #### **Step 3:** If a solution pawn is on the last line, the player won.

This algorithm can be similar to _Mathematical induction_ (_"Raisonnement par Récurrence"_ in French) in Maths ### Other fonctionnalities --- #### **Color** You can customize the main color of this game. Just by pressing a button #### **Languages** Many languages are available. (French , English , Japan , Korean , Greek and Sweden ) #### **Sound/Music** There is an default music made by the author. The volume of the music can be modified from 0.0% to 100.0% #### **Lenght of the Board** The Lenght of the board can go from 5x5 to 50x50
# How to install Python and Pygame ? ## Install Python If Python is not installed on your computer (to verify that, you can do: "```python --version```" on a Terminal. If you don't know how to access a Terminal you can click here : How to access a Terminal) you can click on this link Installing Python, than click on "Download Python 3.X.X". After that, you can execute this File. A window should appear. At the bottom of the screen, there is a small box where it's written: "Add Python3.X to path". Check this box. After that, click on "Customize Installation". Check all the boxes if they aren't checked and click on "Next". Then, click on "Install". After that, you can close the window ## Install Pygame If you want to check if Python is installed you can open a Terminal and write ```python --version```. Installing Pygame is not difficult. Now you need to open a Terminal if there is none open. And just type ```py -m pip install pygame```. It will take some time for being installed. ## Install Hex Game To install Hex Game you need to download this project as a .zip, then you have to decompress it. After the installation and the decompression, you have to execute it by doing ```py main.py```
**** Make sure that you are in the good Folder when you do that. For example, if the file is on your Desktop you should do ```cd Desktop```. You don't understand what I just said? Path of a file in Windows / Mac. How to use CD: Here (It's the same with Mac) ****

近期下载者

相关文件


收藏者