From 4eba7169623928f73edf12f5c0c5ad30b1d2c2a2 Mon Sep 17 00:00:00 2001 From: Abhijith Chatra Date: Wed, 14 Mar 2018 16:53:01 -0700 Subject: [PATCH] Fixing game of life program (#712) There is a bug in decompiler which omits the entire scoped variable set. This is a patch fix until that bug is fixed. --- docs/examples/gameofLife.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/examples/gameofLife.md b/docs/examples/gameofLife.md index 70b1f63b..6be756f2 100644 --- a/docs/examples/gameofLife.md +++ b/docs/examples/gameofLife.md @@ -62,10 +62,11 @@ function show() { //Core function function gameOfLife() { let result: boolean[] = []; + let count = 0; for (let x = 0; x < 5; x++) { for (let y = 0; y < 5; y++) { - let count = 0; + count = 0; //Count the live cells in the next row if ((x + 1) < 5) { @@ -121,4 +122,4 @@ function gameOfLife() { //Initial reset & show reset(); show(); -``` \ No newline at end of file +```