View Single Post
  #5   Spotlight this post!  
Unread 30-07-2014, 03:10
timytamy's Avatar
timytamy timytamy is offline
Registered User
AKA: Tim
FRC #3132 (The Thunder Down Under)
Team Role: Electrical
 
Join Date: Nov 2009
Rookie Year: 2010
Location: Australia
Posts: 293
timytamy has a brilliant futuretimytamy has a brilliant futuretimytamy has a brilliant futuretimytamy has a brilliant futuretimytamy has a brilliant futuretimytamy has a brilliant futuretimytamy has a brilliant futuretimytamy has a brilliant futuretimytamy has a brilliant futuretimytamy has a brilliant futuretimytamy has a brilliant future
Re: How to CALCULATE assist points

You can abuse the fact that assists can be calculated on the diagonal of the grid, if you count the robot-zone combinations along a diagonal, you can find the number of assits for a given column arrangement. If you also swap the columns around, and take the max, you can find the total assists.

Here's a quick example in python:

Code:
#~/usr/bin/env python

import sys

def main ():
    if (len(sys.argv) < 1 + (3*3)):
        return

    grid = [[0,0,0], [0,0,0], [0,0,0]]
    for i in range(0, 3):
        for j in range(0, 3):
            grid[i][j] = int(sys.argv[1+(i*3)+j])

    print "The combination:"
    printgrid(grid)
    print "Has", calcAssists(grid), "assists"

def calcAssists (grid):
    asstCombs = [0]*(3*2*1) # 3! Combinations

    asstCombs[0] = calcDiagonal([grid[0], grid[1], grid[2]])
    asstCombs[1] = calcDiagonal([grid[0], grid[2], grid[1]])
    asstCombs[2] = calcDiagonal([grid[1], grid[0], grid[2]])
    asstCombs[3] = calcDiagonal([grid[1], grid[2], grid[0]])
    asstCombs[4] = calcDiagonal([grid[2], grid[0], grid[1]])
    asstCombs[5] = calcDiagonal([grid[2], grid[1], grid[0]])

    return max(asstCombs)

def calcDiagonal (grid):
    return (grid[0][0] + grid[1][1] + grid[2][2])

def printgrid (grid):
    for i in range(0, 3):
        print str(grid[i][0]), str(grid[i][1]), str(grid[i][2])

if __name__ == "__main__": main()
Hopefully you can adapt that to excel
__________________
Tim W
FIRST® Team 3132 - The Thunder Down Under
Sydney, Australia
Website | Facebook | Youtube

Last edited by timytamy : 30-07-2014 at 09:36.