Event - Code Wars
Are you bored of writing codes for Sorting Algorithms?
Do you want something new?
Quark '08 presents CodeWars to let you code for something unimaginable�
Format
To participate, you must program in GNU C/C++ a strategy for a simple game and send it by email (will be announced later). The game is quite interesting since there is no canonical best strategy. The success of a strategy depends on the behavior of all other teams. You have to make your strategy adaptive to an environment of opponents not known in advance.
Team specifications
Each team may consist of maximum 2 members. Individual participation is also allowed. The last date to submit the code is 10 February 2020.
Scenario
In the kingdom of Darnassus, there was a generous queen Tyrande Whisperwind who donates gold coins. Two people come everyday and inform her of their needs. She however will donate the gold coins only to one person per day. As the queen is generous, she will donate the gold coins to the person with higher needs. But, if the needs of that person are more than double of that of the other one, she will assume that the former is lying and will donate the coins to the latter. The number of coins the queen donates is the logarithmic (to base 2) value of the needs of the particular person.
Rule
Each team must write a program for choosing a number (needs) for the above situation.
- The player can watch the opponent’s number after the completion of the round. Assume that player A chooses x and player B chooses y. This number may vary from 1 to 65535.
- If x = y, no one gets any coins.
- If x > y, then player A wins the round and gets [log2(x)] coins if x ≤ 2y or else B wins the round and gets [log2(y)] coins where [ ] represents the greatest integer function.
- The game consists of 2500 rounds.
- K-Rule : Each player must choose a series of non-decreasing numbers. The series must have a length of atleast k numbers (individually for each player).
For example, suppose A chooses the numbers x1, x2, x3 …
Then, x1 ≤ x2 ≤ x3 ≤ … ≤ xk is required. And then x11 < x10 is allowed.
If xk+1 < xk, then the series begins again and xk+1 ≤ xk+2 ≤ xk+3 ≤ … ≤ x2k is required.
Else, there will be some j for which xj+1 < xj which is where the previous series ends and new one begins and xj+1 ≤ xj+2 ≤ … ≤ xj+k is required.
For example if k = 3, then 1, 2, 3, 4, 1, 2, 3, 1, 4, 6, 8, 9, 1 is allowed.
But the series 1, 2, 3, 4, 5, 1, 2, 1 is not allowed.
- For this competition, the value of k is 10.
Winning Condition
Every program will be tested with every other program including itself. The scores (gold coins) obtained in each game will be summed up. The program that gets the highest sum wins the competition.
The team will be disqualified if they do not follow the K-rule.
The objective of the game is not to win more number of matches. It may be possible that the winner of the tournament has not won the maximum number of matches. It is only the total score obtained that is taken into account for deciding the winner.
Code Format
The team must submit their code as a function
int cwxxxxx(int my_needs[], int opponent_needs[], int day_no)
day_no is the current day (chance number) starting with 1 for the first round and can be upto 2500 for the last round. The my_needs[] array will contain all the needs you have submitted prior to the current round from the indices 0 to (day_no ─ 2) . The opponent_needs[] array will contain the same for the opponent’s needs.
The following predefined function may be used by your program:
int random_no(int low, int high)
This functions returns a random number that lies between the limits low and high both inclusive.
The file submitted by a team should not exceed the size of 100 KB.
Eligibility
All students with a valid identity card of their respective educational institutes are eligible to participate in the event.
Special Note
- The decision of the judges shall be treated as final and binding on all.
- The organizers reserve the rights to change any or all of the above rules as they deem fit. Change in rules, if any will be highlighted on the website and notified to the registered participants.
- Server code:
The game engine downloadable below is not the actual game engine. It will be modified extensively. This is a user-friendly program that has been provided so that participants may understand the engine and test their code.
Along with the game engine, a sample code is also provided (both a.cpp and b.cpp) which is purely based on random numbers. This is provided so that participants can be clear about the format of the code. You may replace the code in any of these files to check your program's performance with the random number generator. You may also replace both the files with your programs and check the performance.
In case your program have more functions, they should start with your teamcode (eg., cwxxxxx_func1() ). Same goes for global variables, if any. It is recommended to use static variables than to use global variables.
- Final submissions Your final code should be submitted to [email protected] on or before 10 February 2020. You need to just submit the function with the team code as a c/c++ file similar to a.cpp.
- Click Here to download the game engine mentioned above.
The server will be compiled using GNU compiler 4.1.2
The C/C++ files which do not compile on the above will not be considered and straight away disqualified.
The compiler could be downloaded directly from the Internet using the following links:
http://www.bloodshed.net/dev/devcpp.html
http://webscripts.softpedia.com/script/Development-Scripts-js/Compilers/GNU-Compiler-Collection-26869.html
Please stay in touch with us using the QUARK forum so that we can solve your queries immediately. The QUARK forum website for Codewars is: http://www.bits-quark.org/forum/viewforum.php?f=15&sid=066843c8e07ac0d8ccaa4fb9eb621a38
Event Managers
Bharath R.
(+91 9890589225) |
Shashank Saraogi
(+91 9881776979) |
|
|