- Mi nincs, grafén akku van: itt a Xiaomi 11T és 11T Pro
- Bemutatkozott a Poco X7 és X7 Pro
- Apple Watch Sport - ez is csak egy okosóra
- Samsung Galaxy S25 - végre van kicsi!
- Samsung Galaxy A54 - türelemjáték
- Apple iPhone 16 - ígéretek földje
- Honor Magic V5 - méret a kamera mögött
- One mobilszolgáltatások
- Milyen okostelefont vegyek?
- Honor Magic5 Pro - kamerák bűvöletében
Új hozzászólás Aktív témák
-
Jhonny06
veterán
Sziasztok!
Kaptam egy teszt feladatot, TicTacToe. A Consultant interface-t kell implementálni, igazából 1 függvény van benne összesen, ami egy adott állás alapján javasol egy lépést, majd azt az értéket visszaadja. Azon gondolkodtam, hogy itt érdemes még létrehozni külön függvényeket (pl. checkForWin, checkForDraw, stb.), vagy elég a suggest függvényen belül implementálni az egész logikát? Ti mit várnátok el, hogy elegáns? Gáz, ha minden azon az egy függvényen belül van, jobban "OO-sítani" kéne?
Az van a leírásban, hogy a meglévő kódon már ne változtassak, de ha a YourConsultant osztályon belül még létre akarnék hozni plusz függvényeket, akkor elegáns lenne először az interface-t módosítani, de ezt elvileg nem akarják. Ezért is gondolom, hogy a suggest függvényben elég lenne megoldani az egészet.
Please advise
public class YourConsultant implements Consultant {
@Override
public CellLocation suggest(GameBoard gameBoard) {
// TODO Auto-generated method stub
return null;
}Leírás:
The goal of this exercise is for you to create an implementation of the
Consultant interface. You can use the provided class YourConsultant that needs
to be finished. We will run your solution against our unit tests. The source
and unit tests for this project may be found in the zip file associated with
this file.
Please read the JavaDoc carefully.
Keep in mind that:
* We are only interested in an implementation for the Consultant interface. We
do not, for instance, want an application that can interact with other
(human) players. We do not expect any kind of GUI, nor do we expect a class
with a main method.
* We are not so much looking for a solution that performs very fast. If your
implementation finds the best solution within a second, that is good enough.
* We are interested in the readability of your code.
* Follow the instructions carefully, but keep it simple! Your solution might of
course require more files (Java types), be careful however not to
over-engineer your solution.
* You are not allowed to change existing code, i.e. do not change existing
files.
Új hozzászólás Aktív témák
A topicot kiemeltem. Valaki nem akar egy nyitó hsz-t írni?:))
- Mi nincs, grafén akku van: itt a Xiaomi 11T és 11T Pro
- CADA, Polymobil, és más építőkockák
- HBO Max
- Motoros topic
- Elektromos autók - motorok
- Miért vezet mindenki úgy, mint egy állat?
- Bemutatkozott a Poco X7 és X7 Pro
- Peugeot, Citroën topik
- TCL LCD és LED TV-k
- Milyen monitort vegyek?
- További aktív témák...
- DELL Universal Dock D6000 docking station (452-BCYH) (DisplayLink)
- Targus Universal USB 3.0 DV1K-2K Compact docking station (DisplayLink)
- Bomba ár! Dell Inspiron 15 3511 - i5-11GEN I 8GB I 256SSD I HDMI I 15,6" FHD I Cam I W11 I Gari
- Telefon felvásárlás!! iPhone X/iPhone Xs/iPhone XR/iPhone Xs Max
- GYÖNYÖRŰ iPhone 13 mini 128GB Blue -1 ÉV GARANCIA - Kártyafüggetlen, MS3138
Állásajánlatok
Cég: FOTC
Város: Budapest