package org.academiadecodigo.bootcamp11.guessinggame;

/**
 * MIT License
 * (c) 2017 Ricardo Constantino
 */

public class Utils {
    public static int giveNumber(int max) {
        int sign = (max > 0) ? 1 : -1;
        max = Math.abs(max);

        double result = Math.random() * (max + 1);
        result = Math.floor(result) * sign;
        return (int) result;
    }
}
