Open AI Championship

Language packages

Round 2: before start

Project

Sandbox

Round 1

Round 2

Finals

Recent comments

16 january 13:02: leloy wrote comment on post Round 1 is over
15 january 14:13: karloid wrote comment on post Round 1 is over
15 january 14:11: karloid wrote comment on post Round 1 is over
15 january 09:00: chel wrote comment on post Round 1 is over
14 january 19:40: fotol wrote comment on post Round 1 is over
14 january 17:03: tyamgin wrote comment on post Round 1 is over
14 january 16:23: mrKIP wrote comment on post Round 1 is over
14 january 14:56: amurushkin wrote comment on post Finals
14 january 14:47: Adhami wrote comment on post Finals
14 january 07:38: amurushkin wrote comment on post Round 1 is over

VK Group

Telegram chat

 

Language packages to create your own strategies for CodeBall are published. We currently support the following languages:

Language Compiler version Links
C++17 GNU C++ 8.2 download
Java Open JDK 1.8 download
C# .NET Core 2.1 download
Python3 Python 3.7.1 download
Ruby Ruby 2.5.3 download
Kotlin Kotlin 1.3.11 download
Rust Rust 1.31 (2018 edition) download
F# F# download
Scala Scala download
JavaScript Node 11.5.0 download

Packages are also available on GitHub.

Each language package contains a set of models (Robot, Player, etc.), MyStrategy class, where you write the logic of your strategy, and files Runner.* and RemoteProcessClient.*, which are necessary for running the strategy process and exchanging data with the game process.



GoodDalek

GoodDalek

АлтГУ

Sitnikov need for manual (Visual Studio): 1. To connect to the project all the source files for package 2. Only connect 4 the header file of the root folder 3. In the project properties, linker (linker) -> input (enter) -> additional dependencies (additional dependencies), add ws2_32.lib

Dec 17, 2018 8:07:39 AM
DevKirill

DevKirill

УрФУ

Earlier in the packets field was the description of the rules

Dec 17, 2018 9:10:31 AM
GS

GS

Tyumen

And where is the support for FreePascal?

Dec 17, 2018 11:54:28 AM
m4shell

Is it possible to add Python2? In quick start, he stated, and there is no…

Dec 17, 2018 2:21:55 PM
andrey.chernov

andrey.chernov

Sergiyev Posad

A possible example for ruby? :)

Dec 17, 2018 6:04:11 PM
obabichev

obabichev

МФТИ

Tried to run the language pack from c++, but ran into a few problems, maybe I just haven’t found the instructions, but I like all the topics have already visited in the main documentation too, anything about it there. - The package is missing build system of the project or Makefile or cmake file in the archive not the project folder idea either, as a consequence of the ide nothing tightens and collect the project cannot. - No instructions for running the collected file (until the scripts just swear at the lack of output file/MyStrategy) under the assumption that I collected. I guess it must be done in the Docker, dockers but to collect I have not, as a consequence is pain. docker build and docker run I mastered, the container is created, but nothing happens….

Dec 17, 2018 10:08:53 PM
pandafas

pandafas

Minsk

Language pack C, (home Windows 10kA and vs2017). Locally bildil (a couple of hours of torment in front of it) Did smartha (moved from Rostovskogo example), even lokalradio start, one player ran and scored a goal. Filled version to the server, it accepted, but during the game the players are stupid… Something wrong with the pros on the server?

Dec 18, 2018 2:16:15 AM
Adler

Adler

Dzyarzhynsk

pandafas

pandafas

Minsk

Language pack C, (home Windows 10kA and vs2017). Locally bildil (a couple of hours of torment in front of it) Did smartha (moved from Rostovskogo example), even lokalradio start, one player ran and scored a goal. Filled version to the server, it accepted, but during the game the players are stupid… Something wrong with the pros on the server?

if C++ package was something wrong, then all strategies in C++ would be below the middle of the top

Dec 18, 2018 2:49:24 AM
MikeWazowski

MikeWazowski

Moscow

Open JDK 1.8 is probably Linux new java-1.8.0-openjdk ? For win10 take Oracle JDK 11.0.1, or there are other recommendations ?

Dec 18, 2018 10:43:46 AM
Scarlet
Adler

Adler

Dzyarzhynsk

if C++ package was something wrong, then all strategies in C++ would be below the middle of the top

In fact, the first strategy for the pros, right on 47th place. And I have the same problem - moved the strategy from quick start, flood the site, and the robots are for the most part, although there are a few games where they actually play. Even to pit two same - on the one hand are, on the other play. So there is somewhere a catch… (hands?) Today the same strategy (with a couple of modified constants) does not pass the verification.

Dec 18, 2018 11:03:27 AM
ardt2

And is it possible for C++ to make the structure(or class) that contains these fields, separately and produce the structure of the Robot and the Ball from her?

structure Entity { double x; double y; double z; double velocity_x; double velocity_y; double velocity_z; double radius; } structure Ball : public virtual Entity { }; Robot structure : public virtual Entity { }

Dec 18, 2018 12:03:11 PM
AlexKol

And is it possible for C++ to make the structure(or class) that contains these fields, separately and produce the structure of the Robot and the Ball from her? structure Entity { double x; double y; double z; double velocity_x; double velocity_y; double velocity_z; double radius; } structure Ball : public virtual Entity { }; Robot structure : public virtual Entity { }

Redefine your objects and all.

Dec 18, 2018 12:14:41 PM
ardt2

Redefine your objects and all.

Yes I can, but it would be nice )) would Not need to write your own constructors for conversion Ball, Robot, Nitro, for example. And anyway, it looks stupid duplication of fields in classes in C++ 17

Dec 18, 2018 12:21:26 PM
AlexKol

Yes I can, but it would be nice )) would Not need to write your own constructors for conversion Ball, Robot, Nitro, for example. And anyway, it looks stupid duplication of fields in classes in C++ 17

And you worked on real projects, with real third-party libraries?))) It will not please everyone

Dec 18, 2018 12:32:37 PM
ardt2

And you worked on real projects, with real third-party libraries?))) It will not please everyone

Worked so and sadness. And here, it would be natural to ask to do not have to write assignment operators for each class separately, for example. And in General, it is necessary to promote good practice. Here the project is small, but still, when you write

class MyRobot : public Vector3 {};

then

class MyStrategy : Strategy public, public MyRobot {};

then

MyNitro class : public Vector3 {}

you want to move the “public Vector3” in the base class Unit, for example

So here, you have to write separate assignment statements and conversion for all structures separately. This in C with classes tov. Of Stroustrup would have looked silly. (

Dec 18, 2018 12:44:06 PM
AlexKol

Worked so and sadness. And here, it would be natural to ask to do not have to write assignment operators for each class separately, for example. And in General, it is necessary to promote good practice. Here the project is small, but still, when you write class MyRobot : public Vector3 {}; then …

I’m even a strategy not thought yet has got beautiful look.

Dec 18, 2018 12:46:18 PM
ardt2

I’m even a strategy not thought yet has got beautiful look.

Yes. ( But so sad to duplicate.

// ————————————————– virtual Vector3& operator = (const Robot& r) { X = (float)r.x; Y = (float)r.y; Z = (float)r.z; return *this; } // ————————————————– virtual Vector3& operator = (const Ball& r) { X = (float)r.x; Y = (float)r.y; Z = (float)r.z; return *this; }

Dec 18, 2018 12:52:00 PM
Ne0

In fact, the first strategy for the pros, right on 47th place. And I have the same problem - moved the strategy from quick start, flood the site, and the robots are for the most part, although there are a few games where they actually play. Even to pit two same - on the one hand are, on the other play. So there is somewhere a catch… (hands?) Today the same strategy (with a couple of modified constants) does not pass the verification.

Ruby robots standing motionless, although local runner, all runs OK. The truth as I see ruby it’s not very popular)

Dec 18, 2018 1:42:05 PM
imsohate

imsohate

Saint Petersburg

support numpy for python is planned or definitely not?

Dec 18, 2018 3:18:01 PM
alkozel

alkozel

Калужский филиал ГУ СДА при Спецстрое России

And constants of the rules, you need to assign? And track its changes?

Dec 18, 2018 3:55:17 PM
httpps

httpps

Kamensk-Ural'skiy

Ne0

Ne0

Ruby robots standing motionless, although local runner, all runs OK. The truth as I see ruby it’s not very popular)

A similar problem in Ruby, local runner everything works fine both sides, standing still

Dec 18, 2018 5:12:23 PM
Counterbalance

Counterbalance

Netherlands

In C++, is it true that I cannot modify Runner.cpp and Strategy.h? I would like Runner.cpp to work like this:

void Runner::run() { 
    ....
    while ((game = remoteProcessClient.read_game()) != nullptr)
         remoteProcessClient.write( strategy->calc(*rules, *game) );
}

I want to do 1 calculation for all robots at the same time. The only possible way seems to be to do that calculation when strategy->act is called for the first time in a tick, using a hack like this:

void MyStrategy::act(const Robot& me, const Rules& rules, const Game& game, Action& action) {
    int firstid = -1;
    for (const Robot& robot : game.robots) if (robot.is_teammate) { firstid = robot.id; break; }
    if (me.id == firstid) commands = calc(rules, game);
    action = commands[me.id];
}

Dec 18, 2018 6:22:37 PM
ardt2
Counterbalance

Counterbalance

Netherlands

In C++, is it true that I cannot modify Runner.cpp and Strategy.h? I would like Runner.cpp to work like this: void Runner::run() { …. while ((game = remoteProcessClient.read_game()) != nullptr) remoteProcessClient.write( strategy->calc(*rules, *game) ); } I want to do 1 calculation for all robots at the same time. The only possible way seems to be to do that calculation when …

First, it’s true. Server will ignore mods to The Runner.

Second, it’s a known puzzle. )) And it has got a very simple solution. I’d believe you’ll find it and thus do not want to spoil.

Dec 18, 2018 6:57:35 PM
ardt2
Counterbalance

Counterbalance

Netherlands

In C++, is it true that I cannot modify Runner.cpp and Strategy.h? I would like Runner.cpp to work like this: void Runner::run() { …. while ((game = remoteProcessClient.read_game()) != nullptr) remoteProcessClient.write( strategy->calc(*rules, *game) ); } I want to do 1 calculation for all robots at the same time. The only possible way seems to be to do that calculation when …

If it will be frustrating and nessesary, thought, I’ll give the solution. )

Dec 18, 2018 7:04:27 PM
Dimon777

Dimon777

Tula

alkozel

alkozel

Калужский филиал ГУ СДА при Спецстрое России

And constants of the rules, you need to assign? And track its changes?

Also interested in this question…

Dec 18, 2018 9:24:13 PM
olsh

olsh

Arkhangelsk

Please enable C# language version 7.3 <PropertyGroup> <OutputType>Exe</OutputType> <TargetFramework>netcoreapp2.1</TargetFramework> <LangVersion>7.3</LangVersion> </PropertyGroup>

Dec 18, 2018 9:28:15 PM
alkozel

alkozel

Калужский филиал ГУ СДА при Спецстрое России

Study the example from “Quick start”. Rust not seen until now. Studying Java, I have implemented the interface impl Entity for Robot. This is possible because the engine to Rust? Do I understand correctly that in Java this implementation will not work without creating your own class?

Dec 18, 2018 9:42:30 PM
awesoon

awesoon

ONER

alkozel

alkozel

Калужский филиал ГУ СДА при Спецстрое России

Study the example from “Quick start”. Rust not seen until now. Studying Java, I have implemented the interface impl Entity for Robot. This is possible because the engine to Rust? Do I understand correctly that in Java this implementation will not work without creating your own class?

No, it’s not the engine, just Rust so you work trait - implement them without changing the class itself. In Java this does not work, but because there are only 2 classes that implement this trait, you can do a little blood, adding overloaded static methods in the outer class.

Dec 18, 2018 11:28:24 PM
KKH

KKH

Khimki

It is not clear what to collect C++ project. In the OBJ file ? And where it then to shove ? I use codeball2018-windows/codeball2018.exe Where and what to put for this simulator ?

Dec 19, 2018 1:43:14 AM
6eJIa9IzZzTeHb

6eJIa9IzZzTeHb

ЗНТУ

Anyone have ideas on how to run the C++ compiler without using Docker?

Dec 19, 2018 2:19:38 AM
6eJIa9IzZzTeHb

6eJIa9IzZzTeHb

ЗНТУ

GoodDalek

GoodDalek

АлтГУ

Sitnikov need for manual (Visual Studio): 1. To connect to the project all the source files for package 2. Only connect 4 the header file of the root folder 3. In the project properties, linker (linker) -> input (enter) -> additional dependencies (additional dependencies), add ws2_32.lib

Thank you

Dec 19, 2018 2:22:26 AM
Quake

Quake

Saint Petersburg

Add support for JavaScript. A link to your language pack: https://github.com/phpspd/js-cgdk-2018

Dec 19, 2018 12:48:01 PM
MikeWazowski

MikeWazowski

Moscow

experts, pls share your experience or tell the kettle what manual to read, docker for win10 put in idea picked up the docker plugin, and then what to do with scripts compile-in-docker.sh and run-in-docker.sh ?

Dec 19, 2018 7:21:35 PM
nicknickq

nicknickq

Rostov-on-Don

Will you support swift?

Dec 21, 2018 12:22:28 AM
mopdobopot

mopdobopot

УрФУ (ранее УрГУ и УГТУ-УПИ)

MikeWazowski

MikeWazowski

Moscow

experts, pls share your experience or tell the kettle what manual to read, docker for win10 put in idea picked up the docker plugin, and then what to do with scripts compile-in-docker.sh and run-in-docker.sh ?

For the local launch of the strategy don’t need Docker, as usual: 1. We start lokalbaner, it starts and waits for messages at some port 2. Run Runner your language pack, it starts to write to this port

Dec 21, 2018 7:28:46 AM
MikeWazowski

MikeWazowski

Moscow

mopdobopot

mopdobopot

УрФУ (ранее УрГУ и УГТУ-УПИ)

For the local launch of the strategy don’t need Docker, as usual: 1. We start lokalbaner, it starts and waits for messages at some port 2. Run Runner your language pack, it starts to write to this port

Thank you! For the same stupid as, I would add that you need 8 JDK

Dec 21, 2018 10:42:56 AM
ESG

ESG

File “C:/Users/-/Desktop/python.3-cgdk/Runner.py”, line 38, in run self.remote_process_client.write(actions, strategy.custom_rendering()) AttributeError: ‘MyStrategy’ object has no attribute ‘custom_rendering’

Dec 21, 2018 9:54:49 PM
mixei4

mixei4

КГУ

ESG

ESG

File “C:/Users/-/Desktop/python.3-cgdk/Runner.py”, line 38, in run self.remote_process_client.write(actions, strategy.custom_rendering()) AttributeError: ‘MyStrategy’ object has no attribute ‘custom_rendering’

Probably, it is necessary to add this attribute ‘custom_rendering’.

https://github.com/MailRuChamps/raic/blob/master/packages/python3/MyStrategy.py

Dec 21, 2018 10:01:01 PM
ESG

ESG

mixei4

mixei4

КГУ

Probably, it is necessary to add this attribute ‘custom_rendering’. https://github.com/MailRuChamps/raic/blob/master/packages/python3/MyStrategy.py

Thank you))

Dec 21, 2018 10:16:54 PM
Wsl_F

Wsl_F

Киевский Национальный Университет имени Тараса Шевченко

And it is normal that in Python the values are not initialized ROBOT_MIN_RADIUS, ROBOT_MAX_RADIUS and others in the class Rules? at the entrance is Jason:

{‘max_tick_count’: 18000, ‘arena’: {‘width’: 60.0, ‘height’: 20.0, ‘depth’: 80.0, ‘bottom_radius’: 3.0, ‘top_radius’: 7.0, ‘corner_radius’: 13.0, ‘goal_top_radius’: 3.0, ‘goal_width’: 30.0, ‘goal_height’: 10.0, ‘goal_depth’: 10.0, ‘goal_side_radius’: 1.0}, ‘team_size’: 2}

Dec 21, 2018 11:39:17 PM
Wsl_F

Wsl_F

Киевский Национальный Университет имени Тараса Шевченко

Wsl_F

Wsl_F

Киевский Национальный Университет имени Тараса Шевченко

And it is normal that in Python the values are not initialized ROBOT_MIN_RADIUS, ROBOT_MAX_RADIUS and others in the class Rules? at the entrance is Jason: {‘max_tick_count’: 18000, ‘arena’: {‘width’: 60.0, ‘height’: 20.0, ‘depth’: 80.0, ‘bottom_radius’: 3.0, ‘top_radius’: 7.0, ‘corner_radius’: 13.0, ‘goal_top_radius’: 3.0, ‘goal_width’: 30.0, ‘goal_height’: 10.0, ‘goal_depth’: 10.0, ‘goal_side_radius’: 1.0}, ‘team_size’: 2}

looks like the new lokal runner fixed

Dec 22, 2018 11:21:28 AM
Casey1984

Casey1984

Rybnoye

Working CMakeList.txt for Qt Creator under Windows:

cmake_minimum_required(VERSION 3.5) project(MyStrategy)

set(CMAKE_CXX_FLAGS “${CMAKE_CXX_FLAGS} -std=c++17 -static \ -fno-optimize-sibling-calls-fno-strict-aliasing -D_WIN32 \ -lm-s-O2 -Wall-Wtype-limits -Wno-unknown-pragmas”)

find_library(ws2_32_LIB ws2_32)

file(GLOB strategy_SRC “.cpp“ ”model/.cpp” “csimplesocket/*.cpp”)

add_executable(MyStrategy ${strategy_SRC})

target_link_libraries(MyStrategy ${ws2_32_LIB})

Dec 22, 2018 12:06:13 PM
Casey1984

Casey1984

Rybnoye

Casey1984

Casey1984

Rybnoye

Working CMakeList.txt for Qt Creator under Windows: cmake_minimum_required(VERSION 3.5) project(MyStrategy) set(CMAKE_CXX_FLAGS “${CMAKE_CXX_FLAGS} -std=c++17 -static \ -fno-optimize-sibling-calls-fno-strict-aliasing -D_WIN32 \ -lm-s-O2 -Wall-Wtype-limits -Wno-unknown-pragmas”) find_library(ws2_32_LIB ws2_32) …

Addition: I use MinGW.

Dec 22, 2018 12:19:36 PM
CoruNethron

CoruNethron

ДВФУ ШЕН

GoodDalek

GoodDalek

АлтГУ

Sitnikov need for manual (Visual Studio): 1. To connect to the project all the source files for package 2. Only connect 4 the header file of the root folder 3. In the project properties, linker (linker) -> input (enter) -> additional dependencies (additional dependencies), add ws2_32.lib

Who uses Device + Mingw, substitute -D_LINUX-DWIN32 in CMakeLists.txt and add at the bottom

if(WIN32) target_link_libraries(wsock32 ws2_32 MyStrategy) endif()

That was enough to build an empty strategy straight from the Device.

Dec 22, 2018 7:22:19 PM
GS

GS

Tyumen

All previous tournaments were support FreePascal. This year support was removed, and no argumentation for this from the organizers of the tournament still has not been announced. On codeforces why no problems with it. You suck.

Dec 23, 2018 1:35:32 PM
awesoon

awesoon

ONER

GS

GS

Tyumen

All previous tournaments were support FreePascal. This year support was removed, and no argumentation for this from the organizers of the tournament still has not been announced. On codeforces why no problems with it. You suck.

You can do PR with the package for Pascal, it is only necessary to implement the model, the interaction with the server and Docker file to compile and run

Dec 23, 2018 3:13:23 PM
mixei4

mixei4

КГУ

GS

GS

Tyumen

All previous tournaments were support FreePascal. This year support was removed, and no argumentation for this from the organizers of the tournament still has not been announced. On codeforces why no problems with it. You suck.

In that year, Pascal wrote 12 people. That’s the whole argument.

Dec 23, 2018 7:24:32 PM
GS

GS

Tyumen

mixei4

mixei4

КГУ

In that year, Pascal wrote 12 people. That’s the whole argument.

So now these 12 people go to the forest?)))))) To put it mildly, incorrect reasoning

Dec 23, 2018 8:19:20 PM
mixei4

mixei4

КГУ

GS

GS

Tyumen

So now these 12 people go to the forest?)))))) To put it mildly, incorrect reasoning

The organizers have provided the opportunity to add support for their language and several languages that people have already added. So everything is quite correct.

Dec 23, 2018 8:29:33 PM
Nehc

Nehc

Пушкино

GS

GS

Tyumen

And where is the support for FreePascal?

Yeah, I’ve been wondering, too..

Dec 24, 2018 3:05:54 PM
demerzel1

demerzel1

China

I’m using C++ on MacOS, and I meet problem that “#include <linux/if_packet.h> #include <linux/if_packet.h> #include <linux/if_ether.h> #include <linux/if.h> #include <sys/sendfile.h>”, on MacOS I can not find these head files. Is there some compatibility lib or something that I can use to replace these head files?

Dec 25, 2018 11:13:29 AM
Gondragos

Gondragos

Vladimir

What are the chances that in the near future will accept any packet with javascript? Tired to duplicate the code for Rust, I don’t even know him (:

Dec 25, 2018 2:44:48 PM
Lisynok

Lisynok

ФФ МГУ

Prompt, run the script Runner on mac I get this error:

Undefined symbols for architecture x86_64: “MyStrategy::MyStrategy()”, referenced from: Runner::run() in Runner-5f3473.o … ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

what you can do with it?

Dec 25, 2018 8:04:34 PM
dbf

dbf

A

Lisynok

Lisynok

ФФ МГУ

Prompt, run the script Runner on mac I get this error: Undefined symbols for architecture x86_64: “MyStrategy::MyStrategy()”, referenced from: Runner::run() in Runner-5f3473.o … ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) …

It is worth to create an issue here: https://github.com/MailRuChamps/raic/issues and specify, what operating system etc added build 32 bit can and does help.

Dec 25, 2018 11:06:44 PM
kirimedia

kirimedia

Moscow

Friends. In c++, I see that global variable is available from act for both robots. Is this normal? I can implement all the logic in calls for the first robot and the second just to give a calculated team?

Dec 28, 2018 8:40:52 PM
oreshnik

oreshnik

Альфастрахование

kirimedia

kirimedia

Moscow

Friends. In c++, I see that global variable is available from act for both robots. Is this normal? I can implement all the logic in calls for the first robot and the second just to give a calculated team?

Yes, that’s what I do

Dec 28, 2018 9:44:59 PM
Igor_Chepelev

Igor_Chepelev

Moscow

GoodDalek

GoodDalek

АлтГУ

Sitnikov need for manual (Visual Studio): 1. To connect to the project all the source files for package 2. Only connect 4 the header file of the root folder 3. In the project properties, linker (linker) -> input (enter) -> additional dependencies (additional dependencies), add ws2_32.lib

Thank you!

Dec 29, 2018 7:14:26 PM
s-a--m

s-a--m

МГТУ им. Н.Э. Баумана

Add someone Kotlin Native?

Jan 7, 2019 6:52:26 PM
karloid

karloid

Saint Petersburg

s-a--m

s-a--m

МГТУ им. Н.Э. Баумана

Add someone Kotlin Native?

Oh, God, why?

Jan 8, 2019 3:07:31 PM
s-a--m

s-a--m

МГТУ им. Н.Э. Баумана

karloid

karloid

Saint Petersburg

Oh, God, why?

``

Add someone Kotlin Native?

Oh, God, why? `` Those who wrote in Java and Kotlin can get nearly free boost in performance. For example, I really miss 20ms for a good busting. View top strategies - most in C++

Jan 9, 2019 12:03:13 PM
karloid

karloid

Saint Petersburg

s-a--m

s-a--m

МГТУ им. Н.Э. Баумана

Add someone Kotlin Native? Oh, God, why? Those who wrote in Java and Kotlin can get nearly free boost in performance. For example, I really miss 20ms for a good busting. View top strategies - most in C++

The only problem is that the boost is not free : Kotlin native raw, the standard library is much less supports single thread and that Busta no, Kotlin native now is not about performance (the performance there is worse than Kotlin/jvm), and about native binaries

Jan 9, 2019 12:17:34 PM