Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * CodinGame planet is being attacked by slimy insectoid aliens.
- * <---
- * Hint:To protect the planet, you can implement the pseudo-code provided in the statement, below the player.
- **/
- // game loop
- while (TRUE)
- {
- fscanf(STDIN, "%s",
- $enemy1 // name of enemy 1
- );
- fscanf(STDIN, "%d",
- $dist1 // distance to enemy 1
- );
- fscanf(STDIN, "%s",
- $enemy2 // name of enemy 2
- );
- fscanf(STDIN, "%d",
- $dist2 // distance to enemy 2
- );
- // Write an action using echo(). DON'T FORGET THE TRAILING \n
- // To debug (equivalent to var_dump): error_log(var_export($var, true));
- echo("enemy\n"); // replace "enemy" with a correct ship name to shoot
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement