From dfa7a3eba12f8ea5548a6dc876c6b85c2886063e Mon Sep 17 00:00:00 2001 From: Andrew Cumming Date: Thu, 28 Sep 2023 10:47:05 -0400 Subject: [PATCH] Remove type info from lcg generator; fix typo in README --- README.md | 2 +- lcg.ipynb | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index e612ccf..9f4ad54 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,6 @@ Built with [Jupyter Book](https://jupyterbook.org/intro.html) To update the website use -`jupyter-book build ../phys645` +`jupyter-book build ../phys512` `ghp-import -n -p -f _build/html` diff --git a/lcg.ipynb b/lcg.ipynb index bcbdef4..962d0af 100644 --- a/lcg.ipynb +++ b/lcg.ipynb @@ -27,7 +27,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 1, "id": "3598ae23", "metadata": {}, "outputs": [], @@ -38,17 +38,16 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 2, "id": "73fab248", "metadata": {}, "outputs": [], "source": [ "# This is the implementation of an LCG from Wikipedia\n", "# https://en.wikipedia.org/wiki/Linear_congruential_generator\n", + "# (simplified by removing type info)\n", "\n", - "from collections.abc import Generator\n", - "\n", - "def lcg(modulus: int, a: int, c: int, seed: int) -> Generator[int, None, None]:\n", + "def lcg(modulus, a, c, seed):\n", " \"\"\"Linear congruential generator.\"\"\"\n", " while True:\n", " seed = (a * seed + c) % modulus\n", @@ -57,7 +56,7 @@ }, { "cell_type": "code", - "execution_count": 39, + "execution_count": 3, "id": "d2b53d68", "metadata": { "scrolled": false