jhylands

Swimming with snake pt1

Jul 26th, 2020 (edited)
1,115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.37 KB | None | 0 0
  1. from collections import defaultdict
  2. def make_dice_board():
  3.     board = defaultdict(lambda:defaultdict(lambda:0))
  4.     for i in range(40):
  5.         for j in range(i+1, i+7):
  6.             board[i][j] = 1./6
  7.     full_board = {}
  8.     for i in range(40):
  9.         full_board[i] = {}
  10.         for j in range(40):
  11.             full_board[i][j] = board[i][j]
  12.     return full_board
  13.  
Advertisement
Add Comment
Please, Sign In to add comment