Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- # Terrain generator
- # Make sure your terminal supports ANSI color codes!
- import random, time
- # List containing "tiles"
- terrain = [
- "\033[32m\033[1m#\033[0m",
- "\033[34m\033[1m~\033[0m",
- "\033[33m*\033[0m",
- "\033[32mo\033[0m"
- ]
- # Generator function
- def generator():
- while True:
- tile = random.randint(1, len(terrain))-1
- print terrain[tile],
- time.sleep(0.3)
- generator()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement