Go to Post I emailed Brandon Martus to have my username changed. It was updated within a day. Champion webmaster at work. - Gregor [more]
Home
Go Back   Chief Delphi > Technical > Technical Discussion
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #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.
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 01:57.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi