Your Task Your task is to implement a version of the guessth
Your Task
Your task is to implement a version of the guess-the-number function like you have on other occasions, except this one:
Is played on an n-dimensional board.
You must meet strict complexity requirements.
Your function must have the following signature.
function y = play(a, b, f)
Where:
a is row vector of length n for n > 0.
b is row vector with length(a) == length(b).
f is the oracle.
The unknown point has integer coordinates and is in the rectangle with lower-left corner a and upper-right corner b.
HINT:
Just like the previous versions of this game, you will need to have a loop body or a recursion. In the 2D version of the game, you may have handled the two dimensions in two separate cases. But because the dimension is now arbitrary, you\'ll need a loop-within-loop structure
Your Task
Your task is to implement a version of the guess-the-number function like you have on other occasions, except this one:
Is played on an n-dimensional board.
You must meet strict complexity requirements.
Your function must have the following signature.
function y = play(a, b, f)
Where:
a is row vector of length n for n > 0.
b is row vector with length(a) == length(b).
f is the oracle.
The unknown point has integer coordinates and is in the rectangle with lower-left corner a and upper-right corner b.
HINT:
Just like the previous versions of this game, you will need to have a loop body or a recursion. In the 2D version of the game, you may have handled the two dimensions in two separate cases. But because the dimension is now arbitrary, you\'ll need a loop-within-loop structure
Your Task
Your task is to implement a version of the guess-the-number function like you have on other occasions, except this one:
Is played on an n-dimensional board.
You must meet strict complexity requirements.
Your function must have the following signature.
function y = play(a, b, f)
Where:
a is row vector of length n for n > 0.
b is row vector with length(a) == length(b).
f is the oracle.
The unknown point has integer coordinates and is in the rectangle with lower-left corner a and upper-right corner b.
HINT:
Just like the previous versions of this game, you will need to have a loop body or a recursion. In the 2D version of the game, you may have handled the two dimensions in two separate cases. But because the dimension is now arbitrary, you\'ll need a loop-within-loop structure
Solution
guessthegame.py
import math
frame.start()
| guessthegame.py import math |
