Código do quebra-cabeças “POWER OF THOR - EPISODE 1”
Esse código é do quebra-cabeças “POWER OF THOR -
EPISODE 1”, do site CodingGame, disponível no Link:
https://www.codingame.com/training/easy/power-of-thor-episode- , o que esse código faz?
import sys
import math
# Auto-generated code below aims at helping you parse
# the standard input according to the problem statement.
surface_n = int(input()) # the number of points used to draw the surface of Mars.
for i in range(surface_n):
# land_x: X coordinate of a surface point. (0 to 6999)
# land_y: Y coordinate of a surface point. By linking all the points together in a sequential fashion, you form the surface of Mars.
land_x, land_y = [int(j) for j in input().split()]
# game loop
while True:
# h_speed: the horizontal speed (in m/s), can be negative.
# v_speed: the vertical speed (in m/s), can be negative.
# fuel: the quantity of remaining fuel in liters.
# rotate: the rotation angle in degrees (-90 to 90).
# power: the thrust power (0 to 4).
x, y, h_speed, v_speed, fuel, rotate, power = [int(i) for i in input().split()]
# Write an action using print
# To debug: print("Debug messages...", file=sys.stderr)
# 2 integers: rotate power. rotate is the desired rotation angle (should be 0 for level 1), power is the desired thrust power (0 to 4).
if v_speed <= -40:
print("0 4")
else:
print("0 0")
EPISODE 1”, do site CodingGame, disponível no Link:
https://www.codingame.com/training/easy/power-of-thor-episode- , o que esse código faz?
import sys
import math
# Auto-generated code below aims at helping you parse
# the standard input according to the problem statement.
surface_n = int(input()) # the number of points used to draw the surface of Mars.
for i in range(surface_n):
# land_x: X coordinate of a surface point. (0 to 6999)
# land_y: Y coordinate of a surface point. By linking all the points together in a sequential fashion, you form the surface of Mars.
land_x, land_y = [int(j) for j in input().split()]
# game loop
while True:
# h_speed: the horizontal speed (in m/s), can be negative.
# v_speed: the vertical speed (in m/s), can be negative.
# fuel: the quantity of remaining fuel in liters.
# rotate: the rotation angle in degrees (-90 to 90).
# power: the thrust power (0 to 4).
x, y, h_speed, v_speed, fuel, rotate, power = [int(i) for i in input().split()]
# Write an action using print
# To debug: print("Debug messages...", file=sys.stderr)
# 2 integers: rotate power. rotate is the desired rotation angle (should be 0 for level 1), power is the desired thrust power (0 to 4).
if v_speed <= -40:
print("0 4")
else:
print("0 0")
Gabriela Ribeiro
Curtidas 0
Respostas
Gabriela Ribeiro
29/05/2018
Eu preciso de comentar linha a linha desse código.
GOSTEI 0