Coder Social home page Coder Social logo

denmaker's People

Contributors

apndx avatar

denmaker's Issues

Vertaisarviointi

DenMaker - Haettu 8.10.2018 klo.21:54

Rakenne

Projektin yleinen rakenne on selkeästi jaoteltu omiin komponentteihin mikä näyttää toimivan hyvin. Luokkien vastuut eivät vaikuttaneet olevan liialliset, mutta parin metodin pituutta voi jossain vaiheessa pilkkoa osa-metodeihin. Suurin osa metodien nimistä olivat toimintaa kuvaavia, ja muuttujien nimissä ei ole paljon huomautettavaa (OwnArrayList:in counter -> size oli jo muutettu uudessa commitissa).

Parannusehdotuksia

1. Yksi testeistä ei mene läpi (voi olla, että on jo korjattu):

screenshot 2018-10-11 at 14 02 49

2.

char uniChar = '\u2588';
String block = String.valueOf(uniChar);

toistetaan monta kertaa Area luokassa, joten sen voisi siirtää private muuttujaksi ja kertoa kommentilla mikä merkki on kyseessä.

3.
Lisäksi Area luokan parametrillista konstruktoria voisi käyttää parametrittomassa konstruktorissa näin:

public Area() {
  this(49, 149)
}

public Area(int areaHeight, int areaWidth) {
  this.areaHeight = areaHeight;
  this.areaWidth = areaWidth;
  this.tiles = new Tile[areaHeight][areaWidth];
  this.roomList = new ArrayList<>();
  
  char uniChar = '\u2588';
  String block = String.valueOf(uniChar);

  for (int y = 0; y < tiles.length; y++) {
    for (int x = 0; x < tiles[y].length; x++) {
      tiles[y][x] = new Tile(block, y, x, null);
    }
  }
}

4.
Onko tarvetta kahdelle buildRooms ja addRooms metodille: buildRooms, jolle annetaan lista, ei näytä olevan missään käytössä paitsi yhdessä testissä? addRooms(int attempts) voisi nimetä kuvaavammin, esim. createRooms, koska se generoi mahdollisia huoneita jotka yritetään lisätä Area:an.

5.
Suorituskykytestaus voisi toimia omana luokkana ja tuottaa tuloksia monesta eri koko ja yritys kombinaatiosta niin, että saa hyvän kuvan algoritmin skaalautuvuudesta yhdellä kertaa, ettei tarvitse ajaa testejä monta kertaa manuaalisesti.

6.
Yksikkötestaus näyttää olevan vielä vaiheessa, vaikka kattavuus on hyvä. Tärkeätä on, että kokonaisuus toimii, mutta on hyvä myös testata luokissa yksittäisiä public metodeja joita muut komponentit käyttävät. Näin näkee nopeasti missä on pieni virhe.

Projekti näyttää hyvältä. Toivottavasti suurten alueiden tehokas luominen onnistuu.

Peer-review

Edit: I totally didn't forget to add the date 16.08 02.10.2018

Overall the quality of the code is good. It is portioned well in small sections that are easy to understand. Of course, there are always some long methods that feel, at first, illegible for an outsider. There is also a good amount of classes that all have a distinct role.

I’m not going to say much about the UI, but I think it should ask again if you give a number outside its range, I was pretty confused at the start when it just kept going. The corridors of the maze that are at the very edge look strange. Easiest fix for that is to just add borders while drawing the dungeon, the other option would be to change the algorithm a little.

As you have probably noticed, the walls seem to disappear during buildMaze( ) because of solidifyWalls( ). I would assume it helps you at some point and adding the walls back should be easy as you already have a method for making a room’s walls and a list of all rooms (Though you have to change it a little, so it leaves the opening to the maze). Still I think the best option is to remove solidifyWalls( ), if you can replace it with a few if-statements.

I don’t know what else to say. Your code is cleaner and simpler than the code I write, so I can’t really help you with making any of that better. At the end I will say that "█" comes out as question mark in Netbeans, just in case it somehow works properly for you. We all know the number one excuse for a programmer is “It works on my machine”.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.