This site works best with JavaScript enabled. Please enable JavaScript to get the best experience from this site.
Hey, I need some help with a small formula, I super suck at math so I'm coming for help
There is a grid of icons, it starts at the top left, it goes down 8 icons, then starts at the top again but 1 to the right
So column length of the grid is 8 No row length limit
Every time an icon has been created, Icon Number is set +1
So there are 2 vars:
Icon Number = 0 Column Length = 8
Help me make 2 formulas for this, 1 for the X offset from top left and 1 for the Y offset from top left
iconOffsetX = (((libCHS - Choice Heroes Created / (libCHS - Option - Hero Icon Column Length)) * 90) <Integer>
or in human readability: iconOffsetX = ((Icon Number / Column Length) * 90)
It's integer so it truncates, so (Icon Number / Column Length) ends up being 1 or 2 or 3 etc
That's what i got for X offset and as testing goes - it is correct but i've been stuck on Y offset for hours now
Edit:
The evil monster known only as 'Math' has been defeated by the righteous being called 'Modulo' !
Behold the outcome of its glorious battle
iconOffsetY 2 = (((libCHS - Choice Heroes Created - 1) mod libCHS - Option - Hero Icon Column Length) * 90) <Integer>
Hey, I need some help with a small formula, I super suck at math so I'm coming for help
There is a grid of icons, it starts at the top left, it goes down 8 icons, then starts at the top again but 1 to the right
So column length of the grid is 8 No row length limit
Every time an icon has been created, Icon Number is set +1
So there are 2 vars:
Icon Number = 0 Column Length = 8
Help me make 2 formulas for this, 1 for the X offset from top left and 1 for the Y offset from top left
iconOffsetX = (((libCHS - Choice Heroes Created / (libCHS - Option - Hero Icon Column Length)) * 90) <Integer>
or in human readability: iconOffsetX = ((Icon Number / Column Length) * 90)
It's integer so it truncates, so (Icon Number / Column Length) ends up being 1 or 2 or 3 etc
That's what i got for X offset and as testing goes - it is correct but i've been stuck on Y offset for hours now
Edit:
The evil monster known only as 'Math' has been defeated by the righteous being called 'Modulo' !
Behold the outcome of its glorious battle
iconOffsetY 2 = (((libCHS - Choice Heroes Created - 1) mod libCHS - Option - Hero Icon Column Length) * 90) <Integer>