From 94b6d3246c72eb3cae58a2fd18771e3c2c3e7cb2 Mon Sep 17 00:00:00 2001 From: zhang Date: Sun, 21 Aug 2022 09:41:53 +0800 Subject: copy --- fun_math/random_walk.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 fun_math/random_walk.py (limited to 'fun_math/random_walk.py') diff --git a/fun_math/random_walk.py b/fun_math/random_walk.py new file mode 100644 index 0000000..b425fcb --- /dev/null +++ b/fun_math/random_walk.py @@ -0,0 +1,14 @@ + +import random + + +# N, S, W, E +choices = [(0, 1), (0, -1), (-1, 0), (1, 0)] + + +def rand_walk(n, p0=[]): + if p0 is None: + p0 = [0, 0] + pass + + -- cgit v1.2.3