Hi! I don't think this was fixed correctly. Attached is a full fix against git.
Thanks, -Kees -- Kees Cook
>From 9da9b99202c6e75d9e82c21b76c69a4feb1553fb Mon Sep 17 00:00:00 2001 From: Kees Cook <k...@outflux.net> Date: Thu, 20 Jan 2011 18:15:36 -0600 Subject: [PATCH] lever: fix force calculations The lever force calculations were backwards. This adjusts to make the math easier to read in the games.xml file. Signed-off-by: Kees Cook <k...@outflux.net> --- data/games.xml | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-) diff --git a/data/games.xml b/data/games.xml index 8e8bd26..7353801 100644 --- a/data/games.xml +++ b/data/games.xml @@ -346,9 +346,9 @@ <variables> int right_pos = 2; int left_pos = 4; - int weight = 2 + random.Next (8) * 2; - int left_weight = left_pos * weight; - int right_weight = left_pos * weight / right_pos; + int left_weight = 2 + random.Next (8) * 2; + int force = left_pos * left_weight; + int right_weight = force / right_pos; </variables> <string text = "?" x = "0.66" y = "0.4" centered = "yes" size = "large"/> <string text = "[left_weight]" x = "0.18" y = "0.4" centered = "yes" size = "large"/> @@ -359,9 +359,9 @@ <variables> int right_pos = 1; int left_pos = 4; - int weight = 2 + random.Next (8) * 2; - int left_weight = left_pos * weight; - int right_weight = weight; + int left_weight = 2 + random.Next (8) * 2; + int force = left_pos * left_weight; + int right_weight = force / right_pos; </variables> <string text = "?" x = "0.58" y = "0.4" centered = "yes" size = "large"/> <string text = "[left_weight]" x = "0.18" y = "0.4" centered = "yes" size = "large"/> -- 1.7.2.3