""" Authors: Sohie Consulted: Date: 2022-04-15 Purpose: Testing code for recursive turtles lab 11 Task 01: tests the turtleBeads printed output to check that box patterns are drawn correctly. """ import recursiveTurtleSOLNS import turtleBeads import optimism turtleBeads.noTrace() testRow = optimism.testFunctionMaybe(recursiveTurtleSOLNS, "row") turtleBeads.teleport(-100, -300) testRow.case(4, 50).checkPrintedLines( "A 1-pensize black horizontal line from (-100, -300) to (-50, -300).", "A 1-pensize black vertical line from (-50, -300) to (-50, -250).", "A 1-pensize black horizontal line from (-50, -250) to (-100, -250).", "A 1-pensize black vertical line from (-100, -250) to (-100, -300).", "A 1-pensize black horizontal line from (-100, -300) to (-50, -300).", "A 1-pensize black horizontal line from (-50, -300) to (0, -300).", "A 1-pensize black vertical line from (0, -300) to (0, -250).", "A 1-pensize black horizontal line from (0, -250) to (-50, -250).", "A 1-pensize black vertical line from (-50, -250) to (-50, -300).", "A 1-pensize black horizontal line from (-50, -300) to (0, -300).", "A 1-pensize black horizontal line from (0, -300) to (50, -300).", "A 1-pensize black vertical line from (50, -300) to (50, -250).", "A 1-pensize black horizontal line from (50, -250) to (0, -250).", "A 1-pensize black vertical line from (0, -250) to (0, -300).", "A 1-pensize black horizontal line from (0, -300) to (50, -300).", "A 1-pensize black horizontal line from (50, -300) to (100, -300).", "A 1-pensize black vertical line from (100, -300) to (100, -250).", "A 1-pensize black horizontal line from (100, -250) to (50, -250).", "A 1-pensize black vertical line from (50, -250) to (50, -300).", "A 1-pensize black horizontal line from (50, -300) to (100, -300).", "A 1-pensize black horizontal line from (100, -300) to (50, -300).", "A 1-pensize black horizontal line from (50, -300) to (0, -300).", "A 1-pensize black horizontal line from (0, -300) to (-50, -300).", "A 1-pensize black horizontal line from (-50, -300) to (-100, -300)." ) turtleBeads.teleport(-200, 150) testRow.case(6, 35).checkPrintedLines( "A 1-pensize black horizontal line from (-200, 150) to (-165, 150).", "A 1-pensize black vertical line from (-165, 150) to (-165, 185).", "A 1-pensize black horizontal line from (-165, 185) to (-200, 185).", "A 1-pensize black vertical line from (-200, 185) to (-200, 150).", "A 1-pensize black horizontal line from (-200, 150) to (-165, 150).", "A 1-pensize black horizontal line from (-165, 150) to (-130, 150).", "A 1-pensize black vertical line from (-130, 150) to (-130, 185).", "A 1-pensize black horizontal line from (-130, 185) to (-165, 185).", "A 1-pensize black vertical line from (-165, 185) to (-165, 150).", "A 1-pensize black horizontal line from (-165, 150) to (-130, 150).", "A 1-pensize black horizontal line from (-130, 150) to (-95, 150).", "A 1-pensize black vertical line from (-95, 150) to (-95, 185).", "A 1-pensize black horizontal line from (-95, 185) to (-130, 185).", "A 1-pensize black vertical line from (-130, 185) to (-130, 150).", "A 1-pensize black horizontal line from (-130, 150) to (-95, 150).", "A 1-pensize black horizontal line from (-95, 150) to (-60, 150).", "A 1-pensize black vertical line from (-60, 150) to (-60, 185).", "A 1-pensize black horizontal line from (-60, 185) to (-95, 185).", "A 1-pensize black vertical line from (-95, 185) to (-95, 150).", "A 1-pensize black horizontal line from (-95, 150) to (-60, 150).", "A 1-pensize black horizontal line from (-60, 150) to (-25, 150).", "A 1-pensize black vertical line from (-25, 150) to (-25, 185).", "A 1-pensize black horizontal line from (-25, 185) to (-60, 185).", "A 1-pensize black vertical line from (-60, 185) to (-60, 150).", "A 1-pensize black horizontal line from (-60, 150) to (-25, 150).", "A 1-pensize black horizontal line from (-25, 150) to (10, 150).", "A 1-pensize black vertical line from (10, 150) to (10, 185).", "A 1-pensize black horizontal line from (10, 185) to (-25, 185).", "A 1-pensize black vertical line from (-25, 185) to (-25, 150).", "A 1-pensize black horizontal line from (-25, 150) to (10, 150).", "A 1-pensize black horizontal line from (10, 150) to (-25, 150).", "A 1-pensize black horizontal line from (-25, 150) to (-60, 150).", "A 1-pensize black horizontal line from (-60, 150) to (-95, 150).", "A 1-pensize black horizontal line from (-95, 150) to (-130, 150).", "A 1-pensize black horizontal line from (-130, 150) to (-165, 150).", "A 1-pensize black horizontal line from (-165, 150) to (-200, 150)." ) turtleBeads.noTrace() testSR = optimism.testFunctionMaybe(recursiveTurtleSOLNS, "spacedRow") turtleBeads.teleport(-300, 250) testSR.case(3, 100).checkPrintedLines( "A 1-pensize black horizontal line from (-300, 250) to (-200, 250).", "A 1-pensize black vertical line from (-200, 250) to (-200, 350).", "A 1-pensize black horizontal line from (-200, 350) to (-300, 350).", "A 1-pensize black vertical line from (-300, 350) to (-300, 250).", "A 1-pensize black horizontal line from (-175, 250) to (-75, 250).", "A 1-pensize black vertical line from (-75, 250) to (-75, 350).", "A 1-pensize black horizontal line from (-75, 350) to (-175, 350).", "A 1-pensize black vertical line from (-175, 350) to (-175, 250).", "A 1-pensize black horizontal line from (-50, 250) to (50, 250).", "A 1-pensize black vertical line from (50, 250) to (50, 350).", "A 1-pensize black horizontal line from (50, 350) to (-50, 350).", "A 1-pensize black vertical line from (-50, 350) to (-50, 250)." ) turtleBeads.noTrace() testDR = optimism.testFunctionMaybe(recursiveTurtleSOLNS, "decreasingRow") turtleBeads.teleport(20, 50) testDR.case(6, 160).checkPrintedLines( "A 1-pensize black horizontal line from (20, 50) to (180, 50).", "A 1-pensize black vertical line from (180, 50) to (180, 210).", "A 1-pensize black horizontal line from (180, 210) to (20, 210).", "A 1-pensize black vertical line from (20, 210) to (20, 50).", "A 1-pensize black horizontal line from (20, 50) to (180, 50).", "A 1-pensize black horizontal line from (180, 50) to (260, 50).", "A 1-pensize black vertical line from (260, 50) to (260, 130).", "A 1-pensize black horizontal line from (260, 130) to (180, 130).", "A 1-pensize black vertical line from (180, 130) to (180, 50).", "A 1-pensize black horizontal line from (180, 50) to (260, 50).", "A 1-pensize black horizontal line from (260, 50) to (300, 50).", "A 1-pensize black vertical line from (300, 50) to (300, 90).", "A 1-pensize black horizontal line from (300, 90) to (260, 90).", "A 1-pensize black vertical line from (260, 90) to (260, 50).", "A 1-pensize black horizontal line from (260, 50) to (300, 50).", "A 1-pensize black horizontal line from (300, 50) to (320, 50).", "A 1-pensize black vertical line from (320, 50) to (320, 70).", "A 1-pensize black horizontal line from (320, 70) to (300, 70).", "A 1-pensize black vertical line from (300, 70) to (300, 50).", "A 1-pensize black horizontal line from (300, 50) to (320, 50).", "A 1-pensize black horizontal line from (320, 50) to (330, 50).", "A 1-pensize black vertical line from (330, 50) to (330, 60).", "A 1-pensize black horizontal line from (330, 60) to (320, 60).", "A 1-pensize black vertical line from (320, 60) to (320, 50).", "A 1-pensize black horizontal line from (320, 50) to (330, 50).", "A 1-pensize black horizontal line from (330, 50) to (335, 50).", "A 1-pensize black vertical line from (335, 50) to (335, 55).", "A 1-pensize black horizontal line from (335, 55) to (330, 55).", "A 1-pensize black vertical line from (330, 55) to (330, 50).", "A 1-pensize black horizontal line from (330, 50) to (335, 50).", "A 1-pensize black horizontal line from (335, 50) to (330, 50).", "A 1-pensize black horizontal line from (330, 50) to (320, 50).", "A 1-pensize black horizontal line from (320, 50) to (300, 50).", "A 1-pensize black horizontal line from (300, 50) to (260, 50).", "A 1-pensize black horizontal line from (260, 50) to (180, 50).", "A 1-pensize black horizontal line from (180, 50) to (20, 50)." ) turtleBeads.noTrace() testNS = optimism.testFunctionMaybe(recursiveTurtleSOLNS, "nestedSquares") turtleBeads.teleport(-200, -50) testNS.case(4, 120).checkPrintedLines( "A 1-pensize black horizontal line from (-200, -50) to (-80, -50).", "A 1-pensize black vertical line from (-80, -50) to (-80, 70).", "A 1-pensize black horizontal line from (-80, 70) to (-200, 70).", "A 1-pensize black vertical line from (-200, 70) to (-200, -50).", "A 1-pensize black horizontal line from (-200, -50) to (-140, -50).", "A 1-pensize black vertical line from (-140, -50) to (-140, 10).", "A 1-pensize black horizontal line from (-140, 10) to (-200, 10).", "A 1-pensize black vertical line from (-200, 10) to (-200, -50).", "A 1-pensize black horizontal line from (-200, -50) to (-170, -50).", "A 1-pensize black vertical line from (-170, -50) to (-170, -20).", "A 1-pensize black horizontal line from (-170, -20) to (-200, -20).", "A 1-pensize black vertical line from (-200, -20) to (-200, -50).", "A 1-pensize black horizontal line from (-200, -50) to (-185, -50).", "A 1-pensize black vertical line from (-185, -50) to (-185, -35).", "A 1-pensize black horizontal line from (-185, -35) to (-200, -35).", "A 1-pensize black vertical line from (-200, -35) to (-200, -50)." ) turtleBeads.noTrace() testD = optimism.testFunctionMaybe(recursiveTurtleSOLNS, "diagonal") turtleBeads.teleport(-400, -50) testD.case(4, 100).checkPrintedLines( "A 1-pensize black horizontal line from (-400, -50) to (-300, -50).", "A 1-pensize black vertical line from (-300, -50) to (-300, 50).", "A 1-pensize black horizontal line from (-300, 50) to (-400, 50).", "A 1-pensize black vertical line from (-400, 50) to (-400, -50).", "A 1-pensize black horizontal line from (-400, -50) to (-300, -50).", "A 1-pensize black vertical line from (-300, -50) to (-300, 50).", "A 1-pensize black horizontal line from (-300, 50) to (-250, 50).", "A 1-pensize black vertical line from (-250, 50) to (-250, 100).", "A 1-pensize black horizontal line from (-250, 100) to (-300, 100).", "A 1-pensize black vertical line from (-300, 100) to (-300, 50).", "A 1-pensize black horizontal line from (-300, 50) to (-250, 50).", "A 1-pensize black vertical line from (-250, 50) to (-250, 100).", "A 1-pensize black horizontal line from (-250, 100) to (-225, 100).", "A 1-pensize black vertical line from (-225, 100) to (-225, 125).", "A 1-pensize black horizontal line from (-225, 125) to (-250, 125).", "A 1-pensize black vertical line from (-250, 125) to (-250, 100).", "A 1-pensize black horizontal line from (-250, 100) to (-225, 100).", "A 1-pensize black vertical line from (-225, 100) to (-225, 125).", "A 1-pensize black horizontal line from (-225, 125) to (-212, 125).", "A 1-pensize black vertical line from (-212, 125) to (-212, 137).", "A 1-pensize black horizontal line from (-212, 137) to (-225, 137).", "A 1-pensize black vertical line from (-225, 137) to (-225, 125).", "A 1-pensize black horizontal line from (-225, 125) to (-212, 125).", "A 1-pensize black vertical line from (-212, 125) to (-212, 137).", "A 1-pensize black horizontal line from (-212, 137) to (-225, 137).", "A 1-pensize black vertical line from (-225, 137) to (-225, 125).", "A 1-pensize black horizontal line from (-225, 125) to (-250, 125).", "A 1-pensize black vertical line from (-250, 125) to (-250, 100).", "A 1-pensize black horizontal line from (-250, 100) to (-300, 100).", "A 1-pensize black vertical line from (-300, 100) to (-300, 50).", "A 1-pensize black horizontal line from (-300, 50) to (-400, 50).", "A 1-pensize black vertical line from (-400, 50) to (-400, -50)." ) turtleBeads.showPicture()