Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
repository:cat_toy [2020/04/02 00:57]
porcaro1 [Cat Toy]
repository:cat_toy [2021/04/07 22:43] (current)
porcaro1
Line 2: Line 2:
 ====Cat Toy==== ====Cat Toy====
 ===Premise=== ===Premise===
-After a long day of work, you return home to be greeted by your favorite feline companion, TicTac. Most days, you would usually play with TicTac by tossing his favorite toy (a bright, red block stuffed full of catnip) around the room and watching him chase it from one end to the other. Unfortunately,​ today you are just too tired to throw TicTac'​s block. Instead you decide to fix the block to a spring so that TicTac can get his exercise with as little effort as possible on your end. You attach the apparatus to a wall, giving the block a slight push, and it begins oscillating back and forth. TicTac is more excited than ever, as his block is now moving in a way that he never knew possible. Deciding that you are curious about this unique form of motion, you choose to computationally model the motion in [[https://​www.glowscript.org/​ | GlowScript]].+After a long day of work, you return home to be greeted by your favorite feline companion, TicTac. Most days, you would usually play with TicTac by tossing his favorite toy (a bright, red block stuffed full of catnip) around the room and watching him chase it from one end to the other. Unfortunately,​ today you are just too tired to throw TicTac'​s block. Instead you decide to fix the block to a spring so that TicTac can get his exercise with as little effort as possible on your end. You attach the apparatus to a wall, giving the block a slight push, and it begins oscillating back and forth. TicTac is more excited than ever, as his block is now moving in a way that he never knew possible. Deciding that you are curious about this unique form of motion, you choose to computationally model the motion in  GlowScript.
  
 ===Minimally Working Program=== ===Minimally Working Program===
-<code Python [enable_line_numbers="​true",​ highlight_lines_extra="​0"]>+[[https://​www.glowscript.org/#/​user/​porcaro1/​folder/​RepositoryPrograms/​program/​CatToy-Incomplete | Link]] 
 +<code Python [enable_line_numbers="​true",​ highlight_lines_extra="​7,​8,​24,​26,​27,​28,​30,​31,​32,​37,​45,​46,​51,​52,​53,​58,​59,​60"]>
  
 GlowScript 2.7 VPython GlowScript 2.7 VPython
Line 55: Line 56:
  
 ===Working Code=== ===Working Code===
 +[[https://​www.glowscript.org/#/​user/​porcaro1/​folder/​RepositoryPrograms/​program/​CatToy-Solution1 | Link]]
 **Horizontal Spring (with Optional Linear Damping)** **Horizontal Spring (with Optional Linear Damping)**
 <code Python [enable_line_numbers="​true",​ highlight_lines_extra="​0"​]>​ <code Python [enable_line_numbers="​true",​ highlight_lines_extra="​0"​]>​
Line 121: Line 123:
     ​     ​
 **Vertical Spring with Gravity** **Vertical Spring with Gravity**
-<code Python [enable_line_numbers="​true",​ highlight_lines_extra="​0"]>+[[https://​www.glowscript.org/#/​user/​porcaro1/​folder/​RepositoryPrograms/​program/​CatToy-Solution2 | Link]] 
 +<code Python [enable_line_numbers="​true",​ highlight_lines_extra="​4,​12,​13,​14,​24,​25,​41,​42,​43,​44,​47,​57"]>
 GlowScript 2.7 VPython GlowScript 2.7 VPython
  
  • repository/cat_toy.1585789037.txt.gz
  • Last modified: 2020/04/02 00:57
  • by porcaro1