Tuesday, September 10, 2013

Lesson 15 - Gravity

Today we implemented the GOF Patterns starting from Singleton and Visitor.Not.We practised the most popular method of code re-use: copy-paste. In vim it's called yank-paste. First we added a new line to our song. It was easy. Now the song goes as in head toes and knees and toes knees and toesThen I teached her how to move up and down in vim, using the j and k keys. We had an exercise where I shouted UP and DOWN randomly and she had to follow the orders with the cursor. First she tried to use the mouse but we soon established that vim doesn't obey the mouse. Soon she mastered the movevents and we were ready for copy-pasting. So, we moved to line 1 and yanked it using "yy". Then went to the end and pasted it using "p". This for both lines. She was happy to achieve so much with so little effort!Then she told me the lyrics are all wrong. They should go like "head shoulders knees and toes" instead. Damn! We decided to fix that next time and had fun with "cat pää|say" instead. The computer was a lousy singer but we listened to it many times nevertheless. This was a fun lesson!After the lesson I questioned her and she still remembered the movements, yanking and pasting. The hardest thing is still remembering to enter a space between words. In fact, I promised her a cookie for each space she remembers and she actually remembered on this time. The offer still stands, so let's see if she remembers better next time.Oh, and yesterday we discussed whether people on the other side of Earth stand head-down. We discussed gravity and she drew a very nice diagram that show the force vectors for two girls on the opposite sides of the world: