Tawnymender12


Code/Games

Home Code/Games About me

Wiggle

a python executable that makes a zig zag out of the string, width and height of your choice.

download


The code:


      import time

      wiggle = """
      *           *  * * *     * * *       * * *     *       * * * *
       *         *     *     *       *   *       *   *       *
        *   *   *      *     *           *           *       * * * *
         * * * *       *     *     ***   *     ***   *       *
          *   *      * * *    * * *  *    * * *  *   * * *   * * * *
      """
      print(wiggle)

      string = input("string: ")
      width = int(input("width: "))
      rpt = int(input("repeat times: "))
      i = 0
      rpted = 0

      while rpted < rpt:
          while i < width:
              print((" " * i) + string)
              i+=1
              time.sleep(0.05)
          else:
              while i > 0:
                  print((" " * i) + string)
                  i-=1
                  time.sleep(0.05)
          rpted+=1

      end = input("press enter to exit")