Pebble basic multirun.py

From Werner KRAUTH

(Difference between revisions)
Jump to: navigation, search
Revision as of 21:03, 22 September 2015
Werner (Talk | contribs)

← Previous diff
Current revision
Werner (Talk | contribs)

Line 1: Line 1:
- import random+This page presents the program pebble_basic_multirun.py, a simple linear algebra algorithm for simulating the pebble game (several times).
 +__FORCETOC__
 +=Description=
 +
 +=Program=
 +
 +
 + import random
 +
neighbor = [[1, 3, 0, 0], [2, 4, 0, 1], [2, 5, 1, 2], neighbor = [[1, 3, 0, 0], [2, 4, 0, 1], [2, 5, 1, 2],
[4, 6, 3, 0], [5, 7, 3, 1], [5, 8, 4, 2], [4, 6, 3, 0], [5, 7, 3, 1], [5, 8, 4, 2],
Line 13: Line 21:
site = neighbor[site][random.randint(0, 3)] site = neighbor[site][random.randint(0, 3)]
print site print site
 +=Version=
 +See history for version information.
 +
 +[[Category:Python]]
 +[[Category:Honnef_2015]]
 +[[Category:MOOC_SMAC]]

Current revision

This page presents the program pebble_basic_multirun.py, a simple linear algebra algorithm for simulating the pebble game (several times).


Contents

Description

Program

import random

neighbor =  [[1, 3, 0, 0], [2, 4, 0, 1], [2, 5, 1, 2],
             [4, 6, 3, 0], [5, 7, 3, 1], [5, 8, 4, 2],
             [7, 6, 6, 3], [8, 7, 6, 4], [8, 8, 7, 5]]
t_max = 4
N_runs = 25600
for run in range(N_runs):
    site = 8
    t = 0
    while t < t_max:
        t += 1
        site = neighbor[site][random.randint(0, 3)]
    print site

Version

See history for version information.

Personal tools