Making a small grid
This is a problem set. Some of these are easy, others are far more difficult. The purpose of these problems sets are to HELP YOU THINK THROUGH problems. The solution is at the bottom of this page, but please don't look at it until you have tried (and failed) at least three or four times.
You have a simple 25 x 25 grid. You can move up, down, left and right. Add:
- a bad guy
- basic AI
- basic statistics for the bad guy (or you) like Hit Points, Armour, Power, etc...
Some Code to Get You Started
import random grid =  # let's make our map.We assume a 25 x 25 map for i in range(0,625): grid.append(random.randrange(1,4)) def draw_board(): row = 0 for i in range(0,625): print(str(i).zfill(3),end=' ') row = row + 1 if row == 25: print ("\n") row = 0 return draw_board()
Take This Farther
You want to go farther?
- add color to this.
- add many types of different entities (google nethack)
- add an option to SAVE / RESTORE a game
How you will be assessed
Every problem set is a formative assignment. Please click here to see how you will be graded