Git Product home page Git Product logo

elmlive-randommaps's Introduction

elmlive random maps (fuzz testing)

Following along @avh4 #elmlive youtube 5 parts starting here

youtube

"Today we learn about fuzz tests (property tests) and try to make a random map generator using test-driven development."

<<<<<<< HEAD

some Town Maps during the elmlive session

First random map with tiles Another Random Map with tiles

Random map with 3 doors and some roadsRandom doors in Random town

First random map with tiles Another Random Map with tiles

origin/master

Code is at https://github.com/ElmLive/random-maps/tree/ElmLive-2016-10-02

the tiles come from http://pousse.rapiere.free.fr/tome/tome-tiles.htm

the elm module we are using is http://package.elm-lang.org/packages/elm-community/elm-test/latest/

Tips and picks

commands

  • md elmlive-randommaps
  • cd elmlive-randommaps
  • git init
  • elm make
  • echo "/elm-stuff/" >> .gitignore
  • git remote add origin https://github.com/Rolograaf/elmlive-randommaps.git
  • install yarn as alternative to npm
  • set PATH=%PATH%;C:\Program Files (x86)\Yarn\bin
  • npm init or yarn install
  • npm install --save-dev elm elm-live for installing the live server
  • npm run elm-live to start the server ( or ./node_modules/.bin/elm-live src/Main.elm --open )
  • npm install --save-dev elm-test
  • npm run test-init to run ./node_modules/.bin/elm-test init
  • npm run test or yarn test to run elm-test

Rule ideas

  • add a density factor that weights the probability of road tiles vs grass
  • roads should always connect to other roads
  • there should be at least 10% (10 tiles) grass
  • has exactly one Inn, at least one Weapon shop and at least one Armor shop door.
  • there should be at least a road tile adjacent to the doors
  • the doors should be connected to a road tile should be connected to another upto the edge of the town map
  • [ ]

To be continued

https://youtu.be/FUnAImr6gpc?t=970

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.