From c1998b20dbd4ad6af427321ae44c2ae3d460f8e6 Mon Sep 17 00:00:00 2001 From: Zach Ingbretsen <zach@zingbretsen.com> Date: Mon, 23 Sep 2019 12:35:39 -0400 Subject: [PATCH] Formatting --- coco.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/coco.py b/coco.py index 0089f46..6d53ba8 100644 --- a/coco.py +++ b/coco.py @@ -1,7 +1,7 @@ #!/usr/bin/env python --""" --Program to solve the 5 men and the coconuts problem --""" +""" +Program to solve the 5 men and the coconuts problem +""" def f(n, n_people=5, remainder=1): @@ -23,9 +23,9 @@ def solve(n_people=5): i = 0 while True: - multiplier = ( - i * (n - 1) + (n - 2)) # This keeps the t_-1 round divisible by 0 - # to reduce the search space + # This keeps the t_-1 round divisible by 0 to reduce the search space + multiplier = (i * (n_people - 1) + (n_people - 2)) + result = f(multiplier * lcm, n_people) for _ in range(n_people - 1): result = f(result, n_people) -- GitLab