Are Verctor structs supported?


I would like to use vector in Codingame. This datatype is supported by the CLR and present in the System.Windows namespace according to MSDN:

However I do not manage to have it compile. My code looks like the following:

using System;
using System.Linq;
using System.IO;
using System.Text;
using System.Collections;
using System.Collections.Generic;
using System.Windows;

 * Auto-generated code below aims at helping you parse
 * the standard input according to the problem statement.
class Player
    static void Main(string[] args)
        Vector vector1 = new Vector(20, 30);

As a result I get:
error CS0246: The type or namespace name Vector could not be found. Are you missing an assembly reference?

Does it mean I can not use functions out of the System.Windows Assembly in Codingame? Is this expected? Can it be fixed?

La raison c’est que la structure Vector se trouve dans l’assembly WindowsBase qui n’est pas référencé par défaut dans les applications console car cela fait partie de wpf.

I was assuming so. Yet is still the question open if this is expected - having those classes could pove useful even if I do not implement a GUI.

I would love to see an answer to this as well. I wanted to use either the Vector class from System.Windows namespace or the Vector2 class from the System.Numerics namespace, but I’m having trouble using either of them.

1 Like

I sure could use them for the pod contest going on now!. Not to put any pressure on the codinggame team :slight_smile: