From 88d935a3cd1a31ba8c07a93282d0a65e66fc43a0 Mon Sep 17 00:00:00 2001 From: Michael Leuschel <leuschel@uni-duesseldorf.de> Date: Wed, 15 Apr 2020 15:27:46 +0200 Subject: [PATCH] add goto -1 before setup constants --- puzzles/Peaceable_Armies_of_Queens.ipynb | 90 +++++++++++++++++------- 1 file changed, 65 insertions(+), 25 deletions(-) diff --git a/puzzles/Peaceable_Armies_of_Queens.ipynb b/puzzles/Peaceable_Armies_of_Queens.ipynb index ea71b7f..03b0017 100644 --- a/puzzles/Peaceable_Armies_of_Queens.ipynb +++ b/puzzles/Peaceable_Armies_of_Queens.ipynb @@ -33,7 +33,7 @@ }, { "cell_type": "code", - "execution_count": 18, + "execution_count": 1, "metadata": {}, "outputs": [ { @@ -42,7 +42,7 @@ "Loaded machine: JustQueens" ] }, - "execution_count": 18, + "execution_count": 1, "metadata": {}, "output_type": "execute_result" } @@ -244,16 +244,36 @@ }, { "cell_type": "code", - "execution_count": 15, + "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "Machine constants set up using operation 0: $setup_constants()" + "Changed to state with index -1" ] }, - "execution_count": 15, + "execution_count": 5, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + ":goto -1" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "Machine constants set up using operation 2: $setup_constants()" + ] + }, + "execution_count": 6, "metadata": {}, "output_type": "execute_result" } @@ -264,16 +284,36 @@ }, { "cell_type": "code", - "execution_count": 19, + "execution_count": 7, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "Machine constants set up using operation 0: $setup_constants()" + "Changed to state with index -1" ] }, - "execution_count": 19, + "execution_count": 7, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + ":goto -1" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "Machine constants set up using operation 4: $setup_constants()" + ] + }, + "execution_count": 8, "metadata": {}, "output_type": "execute_result" } @@ -284,16 +324,16 @@ }, { "cell_type": "code", - "execution_count": 20, + "execution_count": 9, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "Machine initialised using operation 1: $initialise_machine()" + "Machine initialised using operation 5: $initialise_machine()" ] }, - "execution_count": 20, + "execution_count": 9, "metadata": {}, "output_type": "execute_result" } @@ -304,7 +344,7 @@ }, { "cell_type": "code", - "execution_count": 21, + "execution_count": 10, "metadata": {}, "outputs": [ { @@ -397,7 +437,7 @@ "<Animation function visualisation>" ] }, - "execution_count": 21, + "execution_count": 10, "metadata": {}, "output_type": "execute_result" } @@ -438,7 +478,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 11, "metadata": {}, "outputs": [ { @@ -447,7 +487,7 @@ "Loaded machine: JustQueens_FindOptimal_CBC" ] }, - "execution_count": 9, + "execution_count": 11, "metadata": {}, "output_type": "execute_result" } @@ -506,16 +546,16 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 12, "metadata": {}, "outputs": [ { "data": { "text/markdown": [ - "Execution time: 17.606007400 seconds" + "Execution time: 10.936093583 seconds" ], "text/plain": [ - "Execution time: 17.606007400 seconds" + "Execution time: 10.936093583 seconds" ] }, "metadata": {}, @@ -527,7 +567,7 @@ "Machine constants set up using operation 0: $setup_constants()" ] }, - "execution_count": 10, + "execution_count": 12, "metadata": {}, "output_type": "execute_result" } @@ -538,7 +578,7 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 13, "metadata": {}, "outputs": [ { @@ -547,7 +587,7 @@ "Machine initialised using operation 1: $initialise_machine()" ] }, - "execution_count": 11, + "execution_count": 13, "metadata": {}, "output_type": "execute_result" } @@ -558,7 +598,7 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": 14, "metadata": {}, "outputs": [ { @@ -570,7 +610,7 @@ "7" ] }, - "execution_count": 12, + "execution_count": 14, "metadata": {}, "output_type": "execute_result" } @@ -581,7 +621,7 @@ }, { "cell_type": "code", - "execution_count": 13, + "execution_count": 15, "metadata": {}, "outputs": [ { @@ -657,7 +697,7 @@ "<Animation function visualisation>" ] }, - "execution_count": 13, + "execution_count": 15, "metadata": {}, "output_type": "execute_result" } -- GitLab