Skip to content

Generate Terrain/Land Using Random Number Generation in Python

License

Notifications You must be signed in to change notification settings

artemis-beta/landsim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

landsim

Generate Terrain/Land Using Random Number Generation in Python! To use this module:

import landsim as ls

x, y = 30, 30                          # Create a map of size 30x30
                                       
my_map = ls.map(x, y, 
                n_cities=20, 
                n_water=5)             # Create map with 20 cities and
                                       # 5 water sources

my_map.add_water_source()              # Randomly add another water source

my_map.add_city()                      # Randomly add a new city

my_map.print_map()                     # Print map to terminal

my_map.print_layer('cities')           # Print only a layer ('land'/'cities')
                                       # the cities layer displays city ids

my_map.get_city_info(i)                # Get info for city id=i

my_map.build_station(i)                # Build at town id=i

Map Display

Alt text

Cities View with IDs

Alt text

About

Generate Terrain/Land Using Random Number Generation in Python

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages