You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

tiles.js 333B

12345678910111213141516
  1. import Tile from "./Tile.js"
  2. export default {
  3. fromLine: function(width, name) {
  4. if (width <= 1) {
  5. return [ new Tile(0, 0, name+"-lr") ];
  6. } else {
  7. return [
  8. new Tile(0, 0, name+"-l"),
  9. Array.from({ length: width - 2 }, (_, i) =>
  10. new Tile(i + 1, 0, name)),
  11. new Tile(width - 1, 0, name+"-r"),
  12. ];
  13. }
  14. },
  15. }