Skip to content

Rolograaf/elmlive-randommaps

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Following along @avh4 #elmlive random maps (fuzz testing)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages