Repository: hedyorg/hedy

Issue:
Mandate quotes in if for strings from level 11
So it needs to be:

`if name is 'Felienne'` and not `if name is Felienne`


Discussion:

Resolving patch:
diff --git a/coursedata/yaml_transformer.py b/coursedata/yaml_transformer.py
--- a/coursedata/yaml_transformer.py
+++ b/coursedata/yaml_transformer.py
@@ -66,10 +66,10 @@ def transform_levels_in_all_YAMLs(old_level, new_level=None, function=nop):
   os.chdir(os.path.join(os.getcwd(), __file__.replace(os.path.basename(__file__), '')))
   transform_level_defaults(old_level, new_level, function)
   # WARNING: adventure do not properly use the transformer function yet!
-  # transform_adventures(old_level, new_level=None, function=nop)
+  # transform_adventures(old_level, new_level, function=nop)
 
 
 def remove_brackets(s):
-  return s.replace('(', ' ').replace(')', '')
+  return s.replace('(', ' ').replace(')', '').replace(':', '').replace('input', 'ask')
 
-transform_levels_in_all_YAMLs("13-old", 14, remove_brackets)
\ No newline at end of file
+transform_levels_in_all_YAMLs('and', 12, remove_brackets)
\ No newline at end of file
diff --git a/hedy.py b/hedy.py
--- a/hedy.py
+++ b/hedy.py
@@ -1191,6 +1191,13 @@ def assign(self, args):
 
 @hedy_transpiler(level=12)
 class ConvertToPython_12(ConvertToPython_11):
+    def andcondition(self, args):
+        return ' and '.join(args)
+    def orcondition(self, args):
+        return ' or '.join(args)
+
+@hedy_transpiler(level=13)
+class ConvertToPython_13(ConvertToPython_12):
     def process_comparison(self, args, operator):
 
         # we are generating an fstring now
@@ -1226,15 +1233,15 @@ def bigger_equal(self, args):
     def not_equal(self, args):
         return self.process_comparison(args, "!=")
 
-@hedy_transpiler(level=13)
-class ConvertToPython_13(ConvertToPython_12):
+@hedy_transpiler(level=14)
+class ConvertToPython_14(ConvertToPython_13):
     def while_loop(self, args):
         args = [a for a in args if a != ""]  # filter out in|dedent tokens
         all_lines = [indent(x) for x in args[1:]]
         return "while " + args[0] + ":\n"+"\n".join(all_lines)
 
-@hedy_transpiler(level=14)
-class ConvertToPython_14(ConvertToPython_13):
+@hedy_transpiler(level=15)
+class ConvertToPython_15(ConvertToPython_14):
     def assign_list(self, args):
         parameter = args[0]
         values = [a for a in args[1:]]
@@ -1325,15 +1332,7 @@ def change_list_item(self, args):
 #         else:
 #             return f"str({arg0}) == str({arg1})" #no and statements
 #
-# @hedy_transpiler(level=15)
-# class ConvertToPython_15(ConvertToPython_14):
-#     def andcondition(self, args):
-#         return ' and '.join(args)
-#     def orcondition(self, args):
-#         return ' or '.join(args)
-
 
-#
 # @hedy_transpiler(level=19)
 # @hedy_transpiler(level=20)
 # class ConvertToPython_19_20(ConvertToPython_18):


Test patch:
diff --git a/archive/tests_level_15.py b/archive/tests_level_15.py
deleted file mode 100644
--- a/archive/tests_level_15.py
+++ /dev/null
@@ -1,106 +0,0 @@
-import hedy
-import textwrap
-from tests_level_01 import HedyTester
-
-class TestsLevel14(HedyTester):
-    level = 14
-
-    def test_bool_true(self):
-        code = textwrap.dedent("""\
-        ja is True
-        if ja is True:
-            print('ja')""")
-        expected = textwrap.dedent("""\
-        ja = True
-        if ja == True:
-          print(f'{ja}')""")
-
-        self.multi_level_tester(
-          max_level=20,
-          code=code,
-          expected=expected,
-          extra_check_function=self.is_not_turtle(),
-          test_name=self.name()
-        )
-
-    def test_bool_false(self):
-        code = textwrap.dedent("""\
-        ja is False
-        if ja is False:
-            print('ja')""")
-        expected = textwrap.dedent("""\
-        ja = False
-        if ja == False:
-          print(f'{ja}')""")
-        self.multi_level_tester(
-          max_level=20,
-          code=code,
-          expected=expected,
-          extra_check_function=self.is_not_turtle(),
-          test_name=self.name()
-        )
-
-    def test_bool_true2(self):
-        code = textwrap.dedent("""\
-        ja is true
-        if ja is True:
-            print('ja')""")
-        expected = textwrap.dedent("""\
-        ja = True
-        if ja == True:
-          print(f'{ja}')""")
-
-        self.multi_level_tester(
-          max_level=20,
-          code=code,
-          expected=expected,
-          extra_check_function=self.is_not_turtle(),
-          test_name=self.name()
-        )
-
-    def test_bool_false2(self):
-        code = textwrap.dedent("""\
-        ja is false
-        if ja is False:
-            print('ja')""")
-        expected = textwrap.dedent("""\
-        ja = False
-        if ja == False:
-          print(f'{ja}')""")
-
-        self.multi_level_tester(
-          max_level=20,
-          code=code,
-          expected=expected,
-          extra_check_function=self.is_not_turtle(),
-          test_name=self.name()
-        )
-
-    def test_bool_total(self):
-        code = textwrap.dedent("""\
-        jebenternog is False
-        benjeernog is input('ben je er nog? ja of nee?')
-        if benjeernog is ja:
-            jebenternog is True
-        if jebenternog is True:
-            print('Hallo!')
-        if jebenternog is False:
-            print('Doei!')""")
-        expected = textwrap.dedent("""\
-        jebenternog = False
-        benjeernog = input('ben je er nog? ja of nee?')
-        if str(benjeernog) == str('ja'):
-          jebenternog = True
-        if jebenternog == True:
-          print(f'Hallo!')
-        if jebenternog == False:
-          print(f'Doei!')""")
-
-        self.multi_level_tester(
-          max_level=20,
-          code=code,
-          expected=expected,
-          extra_check_function=self.is_not_turtle(),
-          test_name=self.name()
-        )
-
diff --git a/archive/tests_level_16.py b/archive/tests_level_16.py
deleted file mode 100644
--- a/archive/tests_level_16.py
+++ /dev/null
@@ -1,40 +0,0 @@
-import hedy
-import textwrap
-from tests_level_01 import HedyTester
-
-class TestsLevel15(HedyTester):
-    level = 15
-
-    def test_and(self):
-        code = textwrap.dedent("""\
-        if 5 is 5 and 4 is 4:
-            print('hallo')""")
-        expected = textwrap.dedent("""\
-        if str('5') == str('5') and str('4') == str('4'):
-          print(f'hallo')""")
-
-        self.multi_level_tester(
-          max_level=20,
-          code=code,
-          expected=expected,
-          extra_check_function=self.is_not_turtle(),
-          test_name=self.name()
-        )
-
-    def test_or(self):
-        code = textwrap.dedent("""\
-        if 5 is 5 or 4 is 4:
-            print('hallo')""")
-        expected = textwrap.dedent("""\
-        if str('5') == str('5') or str('4') == str('4'):
-          print(f'hallo')""")
-
-        self.multi_level_tester(
-          max_level=20,
-          code=code,
-          expected=expected,
-          extra_check_function=self.is_not_turtle(),
-          test_name=self.name()
-        )
-
-
diff --git a/tests/test_level_11.py b/tests/test_level_11.py
--- a/tests/test_level_11.py
+++ b/tests/test_level_11.py
@@ -271,28 +271,6 @@ def test_access_variable_before_definition(self):
       test_name=self.name()
     )
 
-  # negative tests
-  def test_assign_string_without_quotes(self):
-    code = textwrap.dedent("""\
-            name is felienne
-            print name""")
-
-    self.multi_level_tester(
-      code=code,
-      exception=hedy.exceptions.UnquotedAssignTextException,
-      test_name=self.name()
-    )
-  
-  def test_list_creation(self):
-    code = textwrap.dedent("""\
-    animals is 'duck', 'dog', 'penguin'""")
-    expected = textwrap.dedent("""\
-    animals = ['duck', 'dog', 'penguin']""")
-    result = hedy.transpile(code, self.level)
-
-    self.assertEqual(expected, result.code)
-    self.assertEqual(False, result.has_turtle)
-
   def test_list_creation_with_spaces(self):
     code = textwrap.dedent("""\
     actions is 'clap your hands', 'stomp your feet', 'shout Hurray'
@@ -318,7 +296,6 @@ def test_list_creation_with_spaces(self):
     self.assertEqual(expected, result.code)
     self.assertEqual(False, result.has_turtle)
 
-
   def test_list_creation_with_numbers(self):
     code = textwrap.dedent("""\
     getallen is 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
@@ -331,3 +308,104 @@ def test_list_creation_with_numbers(self):
     self.assertEqual(expected, result.code)
     self.assertEqual(False, result.has_turtle)
 
+  def test_if_quotes_in_condition(self):
+    code = textwrap.dedent("""\
+    naam is 'Hedy'
+    if naam is 'Hedy'
+        print 'koekoek'""")
+    expected = textwrap.dedent("""\
+    naam = 'Hedy'
+    if str(naam) == str('Hedy'):
+      print(f'koekoek')""")
+    result = hedy.transpile(code, self.level)
+
+    self.assertEqual(expected, result.code)
+    self.assertEqual(False, result.has_turtle)
+
+  def test_if_quotes_and_spaces_in_condition(self):
+    code = textwrap.dedent("""\
+    naam is 'Hedy is top'
+    if naam is 'Hedy is top'
+        print 'koekoek'""")
+    expected = textwrap.dedent("""\
+    naam = 'Hedy is top'
+    if str(naam) == str('Hedy is top'):
+      print(f'koekoek')""")
+    result = hedy.transpile(code, self.level)
+
+    self.assertEqual(expected, result.code)
+    self.assertEqual(False, result.has_turtle)
+
+  def test_if_else_quotes_in_condition(self):
+    code = textwrap.dedent("""\
+    naam is 'Hedy'
+    if naam is 'Hedy'
+        print 'koekoek'
+    else
+        print 'soepkip'""")
+    expected = textwrap.dedent("""\
+    naam = 'Hedy'
+    if str(naam) == str('Hedy'):
+      print(f'koekoek')
+    else:
+      print(f'soepkip')""")
+    result = hedy.transpile(code, self.level)
+
+    self.assertEqual(expected, result.code)
+    self.assertEqual(False, result.has_turtle)
+
+  def test_if_else_no_quotes_for_num_in_condition(self):
+    code = textwrap.dedent("""\
+    antwoord is ask 'Hoeveel is 10 plus 10?'
+    if antwoord is 20
+        print 'Goedzo!'
+        print 'Het antwoord was inderdaad ' antwoord
+    else
+        print 'Foutje'
+        print 'Het antwoord moest zijn ' antwoord""")
+
+    expected = textwrap.dedent("""\
+    antwoord = input('Hoeveel is 10 plus 10?')
+    try:
+      antwoord = int(antwoord)
+    except ValueError:
+      try:
+        antwoord = float(antwoord)
+      except ValueError:
+        pass
+    if str(antwoord) == str('20'):
+      print(f'Goedzo!')
+      print(f'Het antwoord was inderdaad {antwoord}')
+    else:
+      print(f'Foutje')
+      print(f'Het antwoord moest zijn {antwoord}')""")
+
+    result = hedy.transpile(code, self.level)
+
+    self.assertEqual(expected, result.code)
+    self.assertEqual(False, result.has_turtle)
+
+
+  # negative tests
+  def test_assign_string_without_quotes(self):
+    code = textwrap.dedent("""\
+            name is felienne
+            print name""")
+
+    self.multi_level_tester(
+      code=code,
+      exception=hedy.exceptions.UnquotedAssignTextException,
+      test_name=self.name()
+    )
+  
+  def test_list_creation(self):
+    code = textwrap.dedent("""\
+    animals is 'duck', 'dog', 'penguin'""")
+    expected = textwrap.dedent("""\
+    animals = ['duck', 'dog', 'penguin']""")
+    result = hedy.transpile(code, self.level)
+
+    self.assertEqual(expected, result.code)
+    self.assertEqual(False, result.has_turtle)
+
+
diff --git a/tests/test_level_12.py b/tests/test_level_12.py
--- a/tests/test_level_12.py
+++ b/tests/test_level_12.py
@@ -1,3 +1,4 @@
+
 import hedy
 import textwrap
 from test_level_01 import HedyTester
@@ -5,36 +6,22 @@
 class TestsLevel12(HedyTester):
   level = 12
 
-  def tests_smaller(self):
+  def test_and(self):
     code = textwrap.dedent("""\
-      leeftijd is ask 'Hoe oud ben jij?'
-      if leeftijd < 12
-          print 'Dan ben je jonger dan ik!'""")
+      naam is ask 'hoe heet jij?'
+      leeftijd is ask 'hoe oud ben jij?'
+      if naam is 'Felienne' and leeftijd is 37
+          print 'hallo jij!'""")
     expected = textwrap.dedent("""\
-      leeftijd = input('Hoe oud ben jij?')
+      naam = input('hoe heet jij?')
       try:
-        leeftijd = int(leeftijd)
+        naam = int(naam)
       except ValueError:
         try:
-          leeftijd = float(leeftijd)
+          naam = float(naam)
         except ValueError:
           pass
-      if str(leeftijd).zfill(100)<str(12).zfill(100):
-        print(f'Dan ben je jonger dan ik!')""")
-
-    self.multi_level_tester(
-      code=code,
-      expected=expected,
-      extra_check_function=self.is_not_turtle(),
-      test_name=self.name()
-    )
-  def tests_bigger(self):
-    code = textwrap.dedent("""\
-      leeftijd is ask 'Hoe oud ben jij?'
-      if leeftijd > 12
-          print 'Dan ben je ouder dan ik!'""")
-    expected = textwrap.dedent("""\
-      leeftijd = input('Hoe oud ben jij?')
+      leeftijd = input('hoe oud ben jij?')
       try:
         leeftijd = int(leeftijd)
       except ValueError:
@@ -42,8 +29,8 @@ def tests_bigger(self):
           leeftijd = float(leeftijd)
         except ValueError:
           pass
-      if str(leeftijd).zfill(100)>str(12).zfill(100):
-        print(f'Dan ben je ouder dan ik!')""")
+      if str(naam) == str('Felienne') and str(leeftijd) == str('37'):
+        print(f'hallo jij!')""")
 
     self.multi_level_tester(
       code=code,
@@ -51,78 +38,14 @@ def tests_bigger(self):
       extra_check_function=self.is_not_turtle(),
       test_name=self.name()
     )
-  def tests_smaller_else(self):
-    code = textwrap.dedent("""\
-      leeftijd is ask 'Hoe oud ben jij?'
-      if leeftijd < 12
-          print 'Dan ben je jonger dan ik!'
-      else
-          print 'Dan ben je ouder dan ik!'""")
-    expected = textwrap.dedent("""\
-      leeftijd = input('Hoe oud ben jij?')
-      try:
-        leeftijd = int(leeftijd)
-      except ValueError:
-        try:
-          leeftijd = float(leeftijd)
-        except ValueError:
-          pass
-      if str(leeftijd).zfill(100)<str(12).zfill(100):
-        print(f'Dan ben je jonger dan ik!')
-      else:
-        print(f'Dan ben je ouder dan ik!')""")
 
-    self.multi_level_tester(
-      code=code,
-      expected=expected,
-      extra_check_function=self.is_not_turtle(),
-      test_name=self.name()
-    )
-
-  def test_not_equal(self):
-      code = textwrap.dedent("""\
-        land is ask 'In welk land woon jij?'
-        if land != Nederland
-            print 'Cool!'
-        else
-            print 'Ik kom ook uit Nederland!'""")
-      expected = textwrap.dedent("""\
-        land = input('In welk land woon jij?')
-        try:
-          land = int(land)
-        except ValueError:
-          try:
-            land = float(land)
-          except ValueError:
-            pass
-        if str(land).zfill(100)!='Nederland'.zfill(100):
-          print(f'Cool!')
-        else:
-          print(f'Ik kom ook uit Nederland!')""")
-      self.multi_level_tester(
-
-        code=code,
-        expected=expected,
-        extra_check_function=self.is_not_turtle(),
-        test_name=self.name()
-      )
-
-  def tests_smaller_equal(self):
+  def test_or(self):
     code = textwrap.dedent("""\
-      leeftijd is ask 'Hoe oud ben jij?'
-      if leeftijd <= 12
-          print 'Dan ben je jonger dan ik!'""")
+      if 5 is 5 or 4 is 4
+          print 'hallo'""")
     expected = textwrap.dedent("""\
-      leeftijd = input('Hoe oud ben jij?')
-      try:
-        leeftijd = int(leeftijd)
-      except ValueError:
-        try:
-          leeftijd = float(leeftijd)
-        except ValueError:
-          pass
-      if str(leeftijd).zfill(100)<=str(12).zfill(100):
-        print(f'Dan ben je jonger dan ik!')""")
+      if str('5') == str('5') or str('4') == str('4'):
+        print(f'hallo')""")
 
     self.multi_level_tester(
       code=code,
@@ -130,53 +53,6 @@ def tests_smaller_equal(self):
       extra_check_function=self.is_not_turtle(),
       test_name=self.name()
     )
-  def tests_bigger_equal(self):
-    code = textwrap.dedent("""\
-      leeftijd is ask 'Hoe oud ben jij?'
-      if leeftijd >= 12
-          print 'Dan ben je ouder dan ik!'""")
-    expected = textwrap.dedent("""\
-      leeftijd = input('Hoe oud ben jij?')
-      try:
-        leeftijd = int(leeftijd)
-      except ValueError:
-        try:
-          leeftijd = float(leeftijd)
-        except ValueError:
-          pass
-      if str(leeftijd).zfill(100)>=str(12).zfill(100):
-        print(f'Dan ben je ouder dan ik!')""")
 
-    self.multi_level_tester(
-      code=code,
-      expected=expected,
-      extra_check_function=self.is_not_turtle(),
-      test_name=self.name()
-    )
-  def tests_smaller_equal_else(self):
-    code = textwrap.dedent("""\
-      leeftijd is ask 'Hoe oud ben jij?'
-      if leeftijd <= 12
-          print 'Dan ben je jonger dan ik!'
-      else
-          print 'Dan ben je ouder dan ik!'""")
-    expected = textwrap.dedent("""\
-      leeftijd = input('Hoe oud ben jij?')
-      try:
-        leeftijd = int(leeftijd)
-      except ValueError:
-        try:
-          leeftijd = float(leeftijd)
-        except ValueError:
-          pass
-      if str(leeftijd).zfill(100)<=str(12).zfill(100):
-        print(f'Dan ben je jonger dan ik!')
-      else:
-        print(f'Dan ben je ouder dan ik!')""")
 
-    self.multi_level_tester(
-      code=code,
-      expected=expected,
-      extra_check_function=self.is_not_turtle(),
-      test_name=self.name()
-    )
\ No newline at end of file
+
diff --git a/tests/test_level_13.py b/tests/test_level_13.py
--- a/tests/test_level_13.py
+++ b/tests/test_level_13.py
@@ -5,24 +5,22 @@
 class TestsLevel13(HedyTester):
   level = 13
 
-  def test_while_equals(self):
+  def tests_smaller(self):
     code = textwrap.dedent("""\
-      antwoord is 0
-      while antwoord != 25
-          antwoord is ask 'Wat is 5 keer 5?'
-      print 'Goed gedaan!'""")
+      leeftijd is ask 'Hoe oud ben jij?'
+      if leeftijd < 12
+          print 'Dan ben je jonger dan ik!'""")
     expected = textwrap.dedent("""\
-    antwoord = 0
-    while str(antwoord).zfill(100)!=str(25).zfill(100):
-      antwoord = input(\'Wat is 5 keer 5?\')
+      leeftijd = input('Hoe oud ben jij?')
       try:
-        antwoord = int(antwoord)
+        leeftijd = int(leeftijd)
       except ValueError:
         try:
-          antwoord = float(antwoord)
+          leeftijd = float(leeftijd)
         except ValueError:
           pass
-    print(f'Goed gedaan!')""")
+      if str(leeftijd).zfill(100)<str(12).zfill(100):
+        print(f'Dan ben je jonger dan ik!')""")
 
     self.multi_level_tester(
       code=code,
@@ -30,25 +28,49 @@ def test_while_equals(self):
       extra_check_function=self.is_not_turtle(),
       test_name=self.name()
     )
+  def tests_bigger(self):
+    code = textwrap.dedent("""\
+      leeftijd is ask 'Hoe oud ben jij?'
+      if leeftijd > 12
+          print 'Dan ben je ouder dan ik!'""")
+    expected = textwrap.dedent("""\
+      leeftijd = input('Hoe oud ben jij?')
+      try:
+        leeftijd = int(leeftijd)
+      except ValueError:
+        try:
+          leeftijd = float(leeftijd)
+        except ValueError:
+          pass
+      if str(leeftijd).zfill(100)>str(12).zfill(100):
+        print(f'Dan ben je ouder dan ik!')""")
 
-  def test_while_smaller(self):
+    self.multi_level_tester(
+      code=code,
+      expected=expected,
+      extra_check_function=self.is_not_turtle(),
+      test_name=self.name()
+    )
+  def tests_smaller_else(self):
     code = textwrap.dedent("""\
-      getal is 0
-      while getal < 100000
-          getal is ask 'HOGER!!!!!'
-      print 'Hoog he?'""")
+      leeftijd is ask 'Hoe oud ben jij?'
+      if leeftijd < 12
+          print 'Dan ben je jonger dan ik!'
+      else
+          print 'Dan ben je ouder dan ik!'""")
     expected = textwrap.dedent("""\
-    getal = 0
-    while str(getal).zfill(100)<str(100000).zfill(100):
-      getal = input('HOGER!!!!!')
+      leeftijd = input('Hoe oud ben jij?')
       try:
-        getal = int(getal)
+        leeftijd = int(leeftijd)
       except ValueError:
         try:
-          getal = float(getal)
+          leeftijd = float(leeftijd)
         except ValueError:
           pass
-    print(f'Hoog he?')""")
+      if str(leeftijd).zfill(100)<str(12).zfill(100):
+        print(f'Dan ben je jonger dan ik!')
+      else:
+        print(f'Dan ben je ouder dan ik!')""")
 
     self.multi_level_tester(
       code=code,
@@ -56,3 +78,105 @@ def test_while_smaller(self):
       extra_check_function=self.is_not_turtle(),
       test_name=self.name()
     )
+
+  def test_not_equal(self):
+      code = textwrap.dedent("""\
+        land is ask 'In welk land woon jij?'
+        if land != Nederland
+            print 'Cool!'
+        else
+            print 'Ik kom ook uit Nederland!'""")
+      expected = textwrap.dedent("""\
+        land = input('In welk land woon jij?')
+        try:
+          land = int(land)
+        except ValueError:
+          try:
+            land = float(land)
+          except ValueError:
+            pass
+        if str(land).zfill(100)!='Nederland'.zfill(100):
+          print(f'Cool!')
+        else:
+          print(f'Ik kom ook uit Nederland!')""")
+      self.multi_level_tester(
+
+        code=code,
+        expected=expected,
+        extra_check_function=self.is_not_turtle(),
+        test_name=self.name()
+      )
+
+  def tests_smaller_equal(self):
+    code = textwrap.dedent("""\
+      leeftijd is ask 'Hoe oud ben jij?'
+      if leeftijd <= 12
+          print 'Dan ben je jonger dan ik!'""")
+    expected = textwrap.dedent("""\
+      leeftijd = input('Hoe oud ben jij?')
+      try:
+        leeftijd = int(leeftijd)
+      except ValueError:
+        try:
+          leeftijd = float(leeftijd)
+        except ValueError:
+          pass
+      if str(leeftijd).zfill(100)<=str(12).zfill(100):
+        print(f'Dan ben je jonger dan ik!')""")
+
+    self.multi_level_tester(
+      code=code,
+      expected=expected,
+      extra_check_function=self.is_not_turtle(),
+      test_name=self.name()
+    )
+  def tests_bigger_equal(self):
+    code = textwrap.dedent("""\
+      leeftijd is ask 'Hoe oud ben jij?'
+      if leeftijd >= 12
+          print 'Dan ben je ouder dan ik!'""")
+    expected = textwrap.dedent("""\
+      leeftijd = input('Hoe oud ben jij?')
+      try:
+        leeftijd = int(leeftijd)
+      except ValueError:
+        try:
+          leeftijd = float(leeftijd)
+        except ValueError:
+          pass
+      if str(leeftijd).zfill(100)>=str(12).zfill(100):
+        print(f'Dan ben je ouder dan ik!')""")
+
+    self.multi_level_tester(
+      code=code,
+      expected=expected,
+      extra_check_function=self.is_not_turtle(),
+      test_name=self.name()
+    )
+  def tests_smaller_equal_else(self):
+    code = textwrap.dedent("""\
+      leeftijd is ask 'Hoe oud ben jij?'
+      if leeftijd <= 12
+          print 'Dan ben je jonger dan ik!'
+      else
+          print 'Dan ben je ouder dan ik!'""")
+    expected = textwrap.dedent("""\
+      leeftijd = input('Hoe oud ben jij?')
+      try:
+        leeftijd = int(leeftijd)
+      except ValueError:
+        try:
+          leeftijd = float(leeftijd)
+        except ValueError:
+          pass
+      if str(leeftijd).zfill(100)<=str(12).zfill(100):
+        print(f'Dan ben je jonger dan ik!')
+      else:
+        print(f'Dan ben je ouder dan ik!')""")
+
+    self.multi_level_tester(
+      code=code,
+      expected=expected,
+      extra_check_function=self.is_not_turtle(),
+      test_name=self.name()
+    )
\ No newline at end of file
diff --git a/tests/test_level_14.py b/tests/test_level_14.py
--- a/tests/test_level_14.py
+++ b/tests/test_level_14.py
@@ -1,92 +1,58 @@
+import hedy
 import textwrap
 from test_level_01 import HedyTester
 
-
 class TestsLevel14(HedyTester):
-    level = 14
-
-    def test_print_list_var(self):
-        code = textwrap.dedent("""\
-            dieren is ['Hond', 'Kat', 'Kangoeroe']
-            print dieren[1]""")
-
-        expected = textwrap.dedent("""\
-            dieren = ['Hond', 'Kat', 'Kangoeroe']
-            print(f'{dieren[1-1]}')""")
-
-        check_in_list = (lambda x: HedyTester.run_code(x) == 'Hond')
-
-        self.multi_level_tester(
-            code=code,
-            expected=expected,
-            extra_check_function=check_in_list,
-            test_name=self.name()
-        )
-
-    def test_print_list_access(self):
-        code = textwrap.dedent("""\
-            fruit is ['banaan', 'appel', 'kers'] 
-            print fruit[1]""")
-        expected = textwrap.dedent("""\
-            fruit = ['banaan', 'appel', 'kers']
-            print(f'{fruit[1-1]}')""")
-
-        self.multi_level_tester(
-            code=code,
-            expected=expected,
-            extra_check_function=self.is_not_turtle(),
-            test_name=self.name()
-        )
-
-    def test_list_access_var(self):
-        code = textwrap.dedent("""\
-            fruit is ['banaan', 'appel', 'kers']
-            eerstefruit is fruit[1]
-            print eerstefruit""")
-        expected = textwrap.dedent("""\
-            fruit = ['banaan', 'appel', 'kers']
-            eerstefruit = fruit[1-1]
-            print(f'{eerstefruit}')""")
-
-        self.multi_level_tester(
-            code=code,
-            expected=expected,
-            extra_check_function=self.is_not_turtle(),
-            test_name=self.name()
-        )
-
-    def test_access_plus(self):
-        code = textwrap.dedent("""\
-            lijst is [1, 2, 3]
-            optellen is lijst[1] + lijst[2]
-            optellen is optellen + lijst[3]
-            print optellen""")
-        expected = textwrap.dedent("""\
-            lijst = [1, 2, 3]
-            optellen = lijst[1-1] + lijst[2-1]
-            optellen = optellen + lijst[3-1]
-            print(f'{optellen}')""")
-
-        self.multi_level_tester(
-            code=code,
-            expected=expected,
-            extra_check_function=self.is_not_turtle(),
-            test_name=self.name()
-        )
-
-    def test_list_access_random(self):
-        code = textwrap.dedent("""\
-            fruit is ['banaan', 'appel', 'kers']
-            randomfruit is fruit[random]
-            print randomfruit""")
-        expected = textwrap.dedent("""\
-            fruit = ['banaan', 'appel', 'kers']
-            randomfruit = random.choice(fruit)
-            print(f'{randomfruit}')""")
-
-        self.multi_level_tester(
-            code=code,
-            expected=expected,
-            extra_check_function=self.is_not_turtle(),
-            test_name=self.name()
-        )
+  level = 14
+
+  def test_while_equals(self):
+    code = textwrap.dedent("""\
+      antwoord is 0
+      while antwoord != 25
+          antwoord is ask 'Wat is 5 keer 5?'
+      print 'Goed gedaan!'""")
+    expected = textwrap.dedent("""\
+    antwoord = 0
+    while str(antwoord).zfill(100)!=str(25).zfill(100):
+      antwoord = input(\'Wat is 5 keer 5?\')
+      try:
+        antwoord = int(antwoord)
+      except ValueError:
+        try:
+          antwoord = float(antwoord)
+        except ValueError:
+          pass
+    print(f'Goed gedaan!')""")
+
+    self.multi_level_tester(
+      code=code,
+      expected=expected,
+      extra_check_function=self.is_not_turtle(),
+      test_name=self.name()
+    )
+
+  def test_while_smaller(self):
+    code = textwrap.dedent("""\
+      getal is 0
+      while getal < 100000
+          getal is ask 'HOGER!!!!!'
+      print 'Hoog he?'""")
+    expected = textwrap.dedent("""\
+    getal = 0
+    while str(getal).zfill(100)<str(100000).zfill(100):
+      getal = input('HOGER!!!!!')
+      try:
+        getal = int(getal)
+      except ValueError:
+        try:
+          getal = float(getal)
+        except ValueError:
+          pass
+    print(f'Hoog he?')""")
+
+    self.multi_level_tester(
+      code=code,
+      expected=expected,
+      extra_check_function=self.is_not_turtle(),
+      test_name=self.name()
+    )
diff --git a/tests/test_level_15.py b/tests/test_level_15.py
new file mode 100644
--- /dev/null
+++ b/tests/test_level_15.py
@@ -0,0 +1,92 @@
+import textwrap
+from test_level_01 import HedyTester
+
+
+class TestsLevel15(HedyTester):
+    level = 15
+
+    def test_print_list_var(self):
+        code = textwrap.dedent("""\
+            dieren is ['Hond', 'Kat', 'Kangoeroe']
+            print dieren[1]""")
+
+        expected = textwrap.dedent("""\
+            dieren = ['Hond', 'Kat', 'Kangoeroe']
+            print(f'{dieren[1-1]}')""")
+
+        check_in_list = (lambda x: HedyTester.run_code(x) == 'Hond')
+
+        self.multi_level_tester(
+            code=code,
+            expected=expected,
+            extra_check_function=check_in_list,
+            test_name=self.name()
+        )
+
+    def test_print_list_access(self):
+        code = textwrap.dedent("""\
+            fruit is ['banaan', 'appel', 'kers'] 
+            print fruit[1]""")
+        expected = textwrap.dedent("""\
+            fruit = ['banaan', 'appel', 'kers']
+            print(f'{fruit[1-1]}')""")
+
+        self.multi_level_tester(
+            code=code,
+            expected=expected,
+            extra_check_function=self.is_not_turtle(),
+            test_name=self.name()
+        )
+
+    def test_list_access_var(self):
+        code = textwrap.dedent("""\
+            fruit is ['banaan', 'appel', 'kers']
+            eerstefruit is fruit[1]
+            print eerstefruit""")
+        expected = textwrap.dedent("""\
+            fruit = ['banaan', 'appel', 'kers']
+            eerstefruit = fruit[1-1]
+            print(f'{eerstefruit}')""")
+
+        self.multi_level_tester(
+            code=code,
+            expected=expected,
+            extra_check_function=self.is_not_turtle(),
+            test_name=self.name()
+        )
+
+    def test_access_plus(self):
+        code = textwrap.dedent("""\
+            lijst is [1, 2, 3]
+            optellen is lijst[1] + lijst[2]
+            optellen is optellen + lijst[3]
+            print optellen""")
+        expected = textwrap.dedent("""\
+            lijst = [1, 2, 3]
+            optellen = lijst[1-1] + lijst[2-1]
+            optellen = optellen + lijst[3-1]
+            print(f'{optellen}')""")
+
+        self.multi_level_tester(
+            code=code,
+            expected=expected,
+            extra_check_function=self.is_not_turtle(),
+            test_name=self.name()
+        )
+
+    def test_list_access_random(self):
+        code = textwrap.dedent("""\
+            fruit is ['banaan', 'appel', 'kers']
+            randomfruit is fruit[random]
+            print randomfruit""")
+        expected = textwrap.dedent("""\
+            fruit = ['banaan', 'appel', 'kers']
+            randomfruit = random.choice(fruit)
+            print(f'{randomfruit}')""")
+
+        self.multi_level_tester(
+            code=code,
+            expected=expected,
+            extra_check_function=self.is_not_turtle(),
+            test_name=self.name()
+        )