Question: This is similar to the question [What do I need to install for C++ project / VS 2013 on TeamCity server or Team Foundation Build Service?](https://stackoverflow.com/questions/21559604/what-do-i-need-to-install-for-c-project-vs-2013-on-teamcity-server-or-team-f) but specifically I'd like to do this *without* requiring VisualStudio to be installed on the server.

I notice there's a [List of software on TFS hosted build servers](http://listofsoftwareontfshostedbuildserver.azurewebsites.net/) which seems like it probably has the answer: but most of the links are dead (redirecting just to visualstudio.com) and I can't find downloads for the package names listed.

What do I need to install to build C++ projects, *without* resorting to installing VisualStudio? 

Aside, I've previously gone through this with C#, and eventually figured out how to build C#/VB.NET projects without VisualStudio, but it is definitely a pain. Do the vast majority of people actually doing CI just install IDEs on their build servers?

Answer: 
Use a timing function. Build a series of the 8 possible wins, and run a loop to evaluate the entire series many times (enough to make overhead costs insignificant).

Also, you can do better in the second case. Instead of checking

if x\*\*2 == 9

Try

if abs(x) == 3

The exponentiation, even as a multiply, is slower than letting the hardware operations invert a negative integer.

Even better, don't check the whole board: instead, check only the 2-4 combinations involving the most recent move. Best of all, after the second move, simply maintain a list of winning moves. When you are able to make one of those, there's no check needed.

One way to do this more easily is to number the squares internally as a 3x3 magic square:

```
8 3 4
1 5 9
6 7 2

```

Now, you have a win iff you played three numbers that add up to 15.
I use this algo:

```
def algo(symbols, x, y):
    """Check if someone wins with this move
    0,0  0,1  0,2
    1,0  1,1  1,2
    2,0  2,1  2,2

    2 straight checks: [0][y] & [x][0]
    2 diagonal checks, if x = y or x = 2 - y
    """
    return (symbols[0 * 3 + y] == symbols[1 * 3 + y] == symbols[2 * 3 + y] or
            symbols[x * 3 + 0] == symbols[x * 3 + 1] == symbols[x * 3 + 2] or
            (x == y and symbols[0] == symbols[4] == symbols[8]) or
            (x == 2 - y and symbols[2] == symbols[4] == symbols[6]))

```

It automatically return True or False