public class Util extends Object
| Constructor and Description |
|---|
Util() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
isOpposite(Direction a,
Direction b)
Retorna true se as dadas direções são opostas, false caso contrário.
|
static Point |
lookahead(List<Point> snake,
Direction direction,
int rows,
int columns)
Retorna o ponto a frente da cobra.
|
static List<Direction> |
whereIsTheFood(Point head,
Point food)
Retorna a lista com as direções que a comida está em relação a cabeça da
cobra.
|
public static Point lookahead(List<Point> snake, Direction direction, int rows, int columns)
snake - cobra.direction - direção.rows - número total das linhas.columns - número total das colunas.public static List<Direction> whereIsTheFood(Point head, Point food)
head - cabeça.food - comida.Copyright © 2017 Tecgraf/PUC-Rio. All rights reserved.