Ú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?:))
- Akció! Csere-Beszámítás! Asus ROG G614J! I7 13650HX / RTX 4060 / 16GB DDR5 / 1TB Nvme SSD
- GTX 1050 Ti Windforce OC 4GB
- Ps4 Slim 500GB Alza jótállás+ MM garis Nacon kontroller
- -75% Dell XPS 13 (9320) i7-1260P 16GB Ram/1TB SSD FHD+ Gari
- Dobozos Új Dell Xps 15 9530 i7 13620h 16gb ram 1tb ssd intel uhd graphics+ Intel Arc A370M
- iPhone 13 128GB Red-1 ÉV GARANCIA - Kártyafüggetlen, MS4593, 100% Akkumulátor
- Részletre elérhető , BankMentes lehetőség Dell Alienware AW3225QF 31.6 4K QD OLED Gaming Monitor
- iPhone 13 128GB 100% Green (1év Garancia) - ÚJ EREDETI AKKUMULÁTOR - AKCIÓ
- iKing.Hu - Használt, karcmentes Google Pixel 9 Pro Fold Obsidian színben, 256 GB tárhellyel, 6 hónap
- Telefon felvásárlás!! iPhone 11/iPhone 11 Pro/iPhone 11 Pro Max
Állásajánlatok
Cég: Laptopműhely Bt.
Város: Budapest


