FIRST ROUND OF ELIMINATION - NEOXIAN CITY JINX GAME

in #hive-1769813 years ago

st_1a.jpg

Hello folks and welcome to another episode on the jinx game project, In this episode, I will be expanding on the logic and algorithm behind the first round of elimination called the NORMAL - WIN.

First and foremost, I want to summarize briefly on the player parameters. based on the rules of the game, the player stats is contained in a class defination below.

st_2a.jpg

The logic behind this game is heavily reliant on the index positions of arrays. for instance, the line of code below stores the difference between the original player guess and the random generated number into an array called "closest_guess".

st_1a.jpg

This array would be used to determine which player is closest to the random number.

st_1a1.jpg

Then I begin the next stage of elimination on the data, I had to scan the data according to the rule, rules no.8 and no. 9 state that; dragon jinx and meta dragon players are not eligible to earn a normal win.

jinx_rules2.jpg

So I used a conditional statement to exclude those players
from grabbing the win. The dropdown value of dragon jinx and meta dragon are stored with 7 and 8 which are excluded respectively.

st_1a3.jpg

The normal qualifiers are added dynamically to a list called normal_win_numbers, I prefer using descriptive names when naming my variables, more easy to understand.

Now, I could easily call a min function on the difference array to get the positional value of the closest guess, but what if two players make the same guess, I developed a coin flip logic to determine who gets the win in such cases.

For example, this snippet of code below counts the duplicates occurrences and uses that as a determinant for a coin flip.

st_1bb.jpg

The coin flip logic is contained within the conditional statements below, basically, a random number is generated based on the duplicate counter as the max value.

st_2.jpg

As I said earlier this script is heavily reliant on Indexing, so the positional value of the coin flip is stored in the win_position_idex.

This win_position_idex will be the value that secured the normal win but there is still other hurdles to climb. this normal win can be jinx or stolen away.

In the next episode, I will talk about the logic in the next phase of the elimination, the index position of the player which is initialized in the player-stats class above would be scanned against other players to see who is attacking him/her.

Below is the GUI preview of how the game runs. See you next time :-)
jinx_demo_gif.gif

Sort:  

Nice. Are you programming Jinx game.

Yes brother... I've actually already submitted a working prototype to Sir Neo. just waiting for the approval.

Nice

Whoever is directly controlling the V2K told me to kill myself.
They told me if I killed myself now it would save the lives of countless others.
Saying the longer I wait to kill myself the more people will suffer.


They are reckless and should have shown the proper media what they had before taking me hostage for 5 years. I know there are many in prison that dont deserve to be there because of this. Your stay in prison will not be fun @battleaxe and friends. People are going to want you dead when they find out what you did. I hope you die a slow painful death. You sick mother fuckers.

https://peakd.com/gangstalking/@acousticpulses/electronic-terrorism-and-gaslighting--if-you-downvote-this-post-you-are-part-of-the-problem

Its a terrorist act on American soil while some say its not real or Im a mental case. Many know its real. This is an ignored detrimental to humanity domestic and foreign threat. Ask informed soldiers in the American military what their oath is and tell them about the day you asked me why. Nobody has I guess. Maybe someone told ill informed soldiers they cant protect America from military leaders in control with ill intent. How do we protect locked up soldiers from telling the truth?