Sign in to follow this  
Followers 0
Rutger83

Math help

11 posts in this topic

Hi everyone,

I am making a simple multiplayer turn based game for myself and my colleges. But I am stuck with some mathematic problems, maybe someone can help me, perhaps I should go to some math forum, who knows :P

The problem is the following: after a few survey questions I know my winning percentage vs a player, but I dont know how to calculate my percentage vs mutiply players.

for example:

My percentage vs player 1 is 70%

My percentage vs player 2 is 60%

My percentage vs player 3 is 65%

my winning percentage vs all 3 players is ???

can anyone guide me how to do this?

Share this post


Link to post
Share on other sites



65%

70+60+65/3 = 65


All by me:

"Sometimes you have to go back to where you started, to get to where you want to go." 

"Everybody catches up with everyone, eventually" 

"As you teach others, you are really teaching yourself."

From my dad

"Do not worry about yesterday, as the only thing that you can control is tomorrow."

 

WindowsError.gif

WIKI | Tabs; | Arrays; | Strings | Wiki Arrays | How to ask a Question | Forum Search | FAQ | Tutorials | Original FAQ | ONLINE HELP | UDF's Wiki | AutoIt PDF

AutoIt Snippets | Multple Guis | Interrupting a running function | Another Send

StringRegExp | StringRegExp Help | RegEXTester | REG TUTOR | Reg TUTOT 2

AutoItSetOption | Macros | AutoIt Snippets | Wrapper | Autoit  Docs

SCITE | SciteJump | BB | MyTopics | Programming | UDFs | AutoIt 123 | UDFs Form | UDF

Learning to script | Tutorials | Documentation | IE.AU3 | Games? | FreeSoftware | Path_Online | Core Language

Programming Tips

Excel Changes

ControlHover.UDF

GDI_Plus

Draw_On_Screen

GDI Basics

GDI_More_Basics

GDI Rotate

GDI Graph

GDI  CheckExistingItems

GDI Trajectory

Replace $ghGDIPDll with $__g_hGDIPDll

DLL 101?

Array via Object

GDI Swimlane

GDI Plus French 101 Site

GDI Examples UEZ

GDI Basic Clock

GDI Detection

Ternary operator

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Simplest way of getting a percentage of something is.

Number / 100 * Percentage

or

Number * 0.Percentage

Edited by IanN1990

Share this post


Link to post
Share on other sites

Not Completely understanding what your after but is this any good ?

$Amount = 100
$PlayerPercentage = 0.63 ;63%
$EnemyPercentage = 0.6 ;60%
$EnemyPercentage1 = 0.65 ;65%
$EnemyPercentage2 = 0.7 ;70%

$Player = $Amount*$PlayerPercentage

If $Amount*$EnemyPercentage > $Player Then
ConsoleWrite("Enemy1 wins")
ElseIf $Amount*$EnemyPercentage1 > $Player Then
ConsoleWrite("Enemy2 wins")
ElseIf $Amount*$EnemyPercentage2 > $Player Then
ConsoleWrite("Enemy3 wins")
Else
ConsoleWrite("Player wins")
EndIf

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

I think OP is looking for something like this..

global $Player1 = 70, $Player2 = 60, $Player3 = 65
global $NumberOfPlayers = 3

msgbox(1, 'my winning percentage vs all ' & $NumberOfPlayers & ' players is', $Player1 + $Player2 + $Player3/$NumberOfPlayers & '%')
Edited by nitekram

All by me:

"Sometimes you have to go back to where you started, to get to where you want to go." 

"Everybody catches up with everyone, eventually" 

"As you teach others, you are really teaching yourself."

From my dad

"Do not worry about yesterday, as the only thing that you can control is tomorrow."

 

WindowsError.gif

WIKI | Tabs; | Arrays; | Strings | Wiki Arrays | How to ask a Question | Forum Search | FAQ | Tutorials | Original FAQ | ONLINE HELP | UDF's Wiki | AutoIt PDF

AutoIt Snippets | Multple Guis | Interrupting a running function | Another Send

StringRegExp | StringRegExp Help | RegEXTester | REG TUTOR | Reg TUTOT 2

AutoItSetOption | Macros | AutoIt Snippets | Wrapper | Autoit  Docs

SCITE | SciteJump | BB | MyTopics | Programming | UDFs | AutoIt 123 | UDFs Form | UDF

Learning to script | Tutorials | Documentation | IE.AU3 | Games? | FreeSoftware | Path_Online | Core Language

Programming Tips

Excel Changes

ControlHover.UDF

GDI_Plus

Draw_On_Screen

GDI Basics

GDI_More_Basics

GDI Rotate

GDI Graph

GDI  CheckExistingItems

GDI Trajectory

Replace $ghGDIPDll with $__g_hGDIPDll

DLL 101?

Array via Object

GDI Swimlane

GDI Plus French 101 Site

GDI Examples UEZ

GDI Basic Clock

GDI Detection

Ternary operator

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

Thanks for the suggestions but I dont think its the right thing. Let me try to clarlify it a bit.

I am comparing the hero vs an enemy thus I know that the hero has a 70% change of winning vs enemy 1, and so I also know that the hero has a 60% change of winning vs enemy 2.

But now I want to know my overall winning percentage with both enemies in the game. Which for my feeling should be lower then 60%. Vs enemy 2 I had a 60% but now I can also lose to enemy 1 so this should lower my overall changes of winning, right?

Something like this, might be more in the right direction...might... but its wrong... I dont really know how to solve it :P

global $enemy1 = 70, $enemy2 = 60, $enemy3 = 65

msgbox(1, 'my winning percentage vs all players is', ($enemy1 * ($enemy2/100) * ($enemy3/100)) & '%')
Edited by Rutger83

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

If I were to beat player 1 70% of the time.

If I were to beat player 2 60% of the time.

If I were to beat player 3 65% of the time.

What is my winning percentage for against all 3 players? 65%

Unless, I am misunderstanding what you are looking for - that is the answer. You are going to loose 35% of the time on average.

Edited by nitekram

All by me:

"Sometimes you have to go back to where you started, to get to where you want to go." 

"Everybody catches up with everyone, eventually" 

"As you teach others, you are really teaching yourself."

From my dad

"Do not worry about yesterday, as the only thing that you can control is tomorrow."

 

WindowsError.gif

WIKI | Tabs; | Arrays; | Strings | Wiki Arrays | How to ask a Question | Forum Search | FAQ | Tutorials | Original FAQ | ONLINE HELP | UDF's Wiki | AutoIt PDF

AutoIt Snippets | Multple Guis | Interrupting a running function | Another Send

StringRegExp | StringRegExp Help | RegEXTester | REG TUTOR | Reg TUTOT 2

AutoItSetOption | Macros | AutoIt Snippets | Wrapper | Autoit  Docs

SCITE | SciteJump | BB | MyTopics | Programming | UDFs | AutoIt 123 | UDFs Form | UDF

Learning to script | Tutorials | Documentation | IE.AU3 | Games? | FreeSoftware | Path_Online | Core Language

Programming Tips

Excel Changes

ControlHover.UDF

GDI_Plus

Draw_On_Screen

GDI Basics

GDI_More_Basics

GDI Rotate

GDI Graph

GDI  CheckExistingItems

GDI Trajectory

Replace $ghGDIPDll with $__g_hGDIPDll

DLL 101?

Array via Object

GDI Swimlane

GDI Plus French 101 Site

GDI Examples UEZ

GDI Basic Clock

GDI Detection

Ternary operator

Share this post


Link to post
Share on other sites

But I am facing the enemies simultaneous.

And I might be wrong here, but my feeling says that if I have a 60% of winning vs solely ememy 2, my winning percentage can not become higher when an extra enemy is in the game. Because there is another enemy to lose from, thus my percentage should become lower not higher.

Share this post


Link to post
Share on other sites

How about this, 65/3 = 21.67, does that seem better?


All by me:

"Sometimes you have to go back to where you started, to get to where you want to go." 

"Everybody catches up with everyone, eventually" 

"As you teach others, you are really teaching yourself."

From my dad

"Do not worry about yesterday, as the only thing that you can control is tomorrow."

 

WindowsError.gif

WIKI | Tabs; | Arrays; | Strings | Wiki Arrays | How to ask a Question | Forum Search | FAQ | Tutorials | Original FAQ | ONLINE HELP | UDF's Wiki | AutoIt PDF

AutoIt Snippets | Multple Guis | Interrupting a running function | Another Send

StringRegExp | StringRegExp Help | RegEXTester | REG TUTOR | Reg TUTOT 2

AutoItSetOption | Macros | AutoIt Snippets | Wrapper | Autoit  Docs

SCITE | SciteJump | BB | MyTopics | Programming | UDFs | AutoIt 123 | UDFs Form | UDF

Learning to script | Tutorials | Documentation | IE.AU3 | Games? | FreeSoftware | Path_Online | Core Language

Programming Tips

Excel Changes

ControlHover.UDF

GDI_Plus

Draw_On_Screen

GDI Basics

GDI_More_Basics

GDI Rotate

GDI Graph

GDI  CheckExistingItems

GDI Trajectory

Replace $ghGDIPDll with $__g_hGDIPDll

DLL 101?

Array via Object

GDI Swimlane

GDI Plus French 101 Site

GDI Examples UEZ

GDI Basic Clock

GDI Detection

Ternary operator

Share this post


Link to post
Share on other sites

I guess "winning percentage" is not something rigourously defined here.


This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

it shud be calculated as recalculated procention on know procentage

so nothing is 100% everything is 99.9%

and calculation

$1 = 40
$2 = 10
$3 = 50
$4 = 60
$1_1 = $1-(0.1/(100-$1))
$2_2 = (($2/100)*$1_1)
$3_3 = (($3/100)*$2_2)
$4_4 = (($4/100)*$3_3)
MsgBox(0,'',$4_4)

so on 70% 60% 65% = around 27.2987% to survive

$1 = 70
$2 = 60
$3 = 65
$1_1 = $1-(0.1/(100-$1))
$2_2 = (($2/100)*$1_1)
$3_3 = (($3/100)*$2_2)
MsgBox(0,'',$3_3)

Edit: if i fliped calcylation (messed up maybe) it shud be

$1_1 = $1-(0.1/(100-$1))
$2_2 = (($1_1/100)*$2)
$3_3 = (($2_2/100)*$3)
$4_4 = (($3_3/100)*$4)
;vs
$1_1 = $1-(0.1/(100-$1))
$2_2 = (($2/100)*$1_1)
$3_3 = (($3/100)*$2_2)
$4_4 = (($4/100)*$3_3)

but my head hurts now from math and hell if i can see whats the correct one from 2 of them or are the 2 of them identical

Edited by bogQ

TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
There are those that believe that the perfect heist lies in the preparation.
Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0