[Legends of Code and Magic] Remarks and bugs


Heya, I'm not sure if it's been noted already or if I'm a bit stupid. But i think i found a bug with the mana.

Doing the challenge in PHP and i have noticed that when the $playerMana variable is set by the default code, it's actually 1 less mana than the player actually has during the round; I think this is due to the mana being incremented after the draw phase, and presumably, after the code for that round has been executed.


The number of cards in the deck will be given during the draft too (using playerDeck) so everyone can detect who is the first player and possibly modify draft strategies in consequence. If it's 0 during the first turn of draft, then you're the first player.

The game should be updated today with the changes.

Also, I've published an article to explain what happened during the Sprint: Coding Sprint: Ready, Steady...Oh!
Hope you'll enjoy the reading.


Now that the game will be updated so that everyone can easily determine who will be player 1, can you share how you were doing it?


Sure. Keep in mind they have been (or will be) patched out.

Method #1: Measure time between program start and first input received. There used to be a significant difference between player 1 and player 2.
Method #2: The OS username under which the program runs identifies which player you are (it's the last character of it).
Method #3: This one was mentioned by @BrunoFelthes, did not check it personally. Something about using the process list and finding a jail number. Surely he can explain better.


It should not work, so, I will not give details :smiley:


I'm trying to compile and run the source code, but I'm not familiar with Maven. Typing 'mvn package gets me the directory and jar file target/locam-1.0-SNAPSHOT.jar but attempting to execute the .jar file gives me this error: Error: Could not find or load main class target.locam-1.0-SNAPSHOT.jar. What am I doing wrong?

If I can get through this, I will write up a step-by-step for others.


A quick question - is there a way to measure elapsed execution time (so my code can avoid "timeout")? I'm using Javascript


I'm pretty sure that subtracting one Date by another will give you a result in millisecond


Thanks. It works. Need to see whether it is indicative of the platform "timeout", bot for now it seems to me that it is