I'd like point out something that isn't mentioned in the slides at all. The ideas behind the algorithm are not just games, not just exercises, not just methods of self improvement. I'm reminded of Feynman's story of the wobbling plate. They have very deep implications for how we design programs and how we design programming languages.
The notion of search (logic programming, constraint solving) is a woefully under appreciated topic - I would argue because our programming languages make it very difficult to apply this kind of beautiful knowledge back onto the programming language itself.
What is a type system if not a kind of maze solver? What happens when you apply machine learning like heuristics to a pattern match compiler? What happens if we can apply algorithm rules at the level of the method signature?
Yes learn some algorithms, then question why our programming languages limit how much we can put these great ideas into practice.
There's some good stuff here, but a lot of the psychology is ill-founded. Flow, for example, is probably the most effective form of practice, and play often creates flow. Jamis recommends practicing constantly, but it's extremely well established that spacing your practice out gives you more bang for the buck, more improvement per hour of practice. (This is called "massed practice vs. spaced practice", and it's been known since before the dawn of cognitive psychology.)
(There's some pretty good evidence that you can fill the spaces in between your practice sessions by practicing something else — without losing the benefit of spacing.)
The maze generation algorithms, though, are awesome.
My favorite is still this one by Joe Allen:
/* [email protected] */ /* Amazing */ /* Joe Allen 129.49.12.74 */
int a[1817];main(z,p,q,r){for(p=80;q+p-80;p-=2*a[p])for(z=9;z--;)q=3&(r=time(0)
+r*57)/7,q=q?q-1?q-2?1-p%79?-1:0:p%79-77?1:0:p<1659?79:0:p>158?-79:0,q?!a[p+q*2
]?a[p+=a[p+=q]=q]=q:0:0;for(;q++-1817;)printf(q%79?"%c":"%c\n"," #"[!a[q-1]]);}
I definitely was not recommending constant practice--I agree that doing so will hurt you more than it helps you! I was recommending consistently regular practice.
That's a neat generator, but it occasionally generates almost entirely-blocked mazes. The density is impressive, but at that point you might as well just start reading IOCCC entries.
I like the visualizations for the maze generation a lot.
I actually used (yet another) maze generation algorithm for an xbox360 game I worked on as a school project. The constraints were slightly different because we wanted cycles and no dead ends.
You put all the cells in a list and take them out at random. If there are 3 or more walls, tear down walls until there are less than 3. When you are done you cannot have any dead ends because a dead end must have three walls. Of course you can have unconnected loops, so you have to go through and tear down walls to connect unconnected segments when you are done.
Sounds like you did something similar to what I did a few years ago. During lunch I ran a Quake server and every five minutes it would generate a new random level (random layout, goals, weapons, lighting etc). Cycles and no dead ends are one way to improve the quality of the deathmatch levels and a toggle that I added the first day to the generator.
Another warning, for photosensitive epileptics: there are rapidly flashing lights in that demo. I have a mild form of it and I started to feel weird, so if you're highly sensitive, you'll want to skip running the maze on the slide labeled "aldous-broder-demo".
Here's a tip for UX people: don't make anything flash more than 2 times per second. Also, "in the United States, websites provided by federal agencies are governed by section 508 of the Rehabilitation Act. The Act says that pages shall be designed to avoid causing the screen to flicker with a frequency greater than 2 Hz and less than 55 Hz." So that's the official recommendation.
"Play" is boring if it isn't challenging. I completely disagree with the dichotomy presented at the start of this presentation. It seems to imply that improving is painful, and is something you need to force yourself to do.
(Furthermore, I've never found learning about new algorithms to be taxing, and certainly never regarded it as a four-letter word.)
My intent was definitely not to portray learning as painful. Learning is a joyful thing. But it's not something you can acquire by passively staring at the world. You need to exert yourself if you want to do more than gain a passing acquaintance with things.
Personally I really enjoyed the short slide by slide format a lot. Perhaps it's a short attention span brought on by years in front of a computer, but I struggle with massive walls of text occasionally. At the very least I found it to be a nice changed on top of being an interesting subject.
Ironically, I lost interest in this at some point because of the slide format. With a wall of text, I can figure out how long it is and whether I want to dedicate the time to read it. These cute arrow-key slides were giving me no feedback how many there are and whether it's going to take half an hour to go through them all, so I closed them. Heh.
I was hoping someone had a text version. This form is like a video: I could read all of that in about 30 seconds, probably, versus clicking through for one sentence at a time over 10 minutes. I don't need 40 drawings of smiley faces to understand this.
acquainting yourself with theory is acquainting yourself with new concepts. It gives you building blocks and labels that you can build on, and hang later concepts on. Without the scaffolding that theory gives you, you'll miss many opportunities for insight later.
So very true. The difference between the me one year back and the me now is that I know how and why certain things are the way they are. Understanding is enlightening.
Ultimately, it is that resistance you need to seek out. Look for things that will challenge you consistely (sic). Work at them until the resistance goes away, and then look for something new. That's how you'll grow your craft. That's what will make you better than you are today.
I feel I should point out that a lot of people would consider this bad advice.
"It is critical to remember that play is not exercise."
Focusing on what are you're good at (like algorithms for creating mazes), is in fact exercise. You're getting better at what you already consider yourself good at (assuming you don't stagnate - which I think the article is really getting at.)
I don't understand how this is considered pollution.
How is this different from having a separate page per slide? It seems we have the same result but with a better user experience. Isn't this a feature allowing each slide to be linkable? Why is this considered negative?
Depending on the browser there is no problem, as in some browsers it is completely impossible to navigate to the next slide at all. When exactly did accessibility and standards conformance become unfashionable round here?
Wonderful slides! I hope there will be video further on.
I didn't like "It is critical to remember that play is not exercise." and to improve it I would like to add something like
"But it's totally fine if your exercise feels like play. If your exercise is fun it's so much easier to do".
I'd like to point out that on the first frame with text on it, the text runs off the screen. So i closed it. I don't even know what the slideshow was about :(
firefox 7.0.1
resolution 1280x1024
This is remarkable. The # of ways to solve the same problem is great (ironically, I knew mostly Prim's and Kruskal's algorithms because they are more common), the visualization is great too. I liked the slide format, a bit too long maybe.
Also, since it's a computer science post :) I would have added time complexity, just for sake of completeness.
Pretty. But I would love just a long single page version of it, particularly when it gets to definitions. The page already loads all the content and assets at the start.
I think the author did a great job and took quite some time to share his knowledge with us. Pity the average response on HN tends to be a compliment followed by a but....
I guess we feel we are always smarter than the next guy, he just happens to put in the effort :-)
[+] [-] swannodette|14 years ago|reply
The notion of search (logic programming, constraint solving) is a woefully under appreciated topic - I would argue because our programming languages make it very difficult to apply this kind of beautiful knowledge back onto the programming language itself.
What is a type system if not a kind of maze solver? What happens when you apply machine learning like heuristics to a pattern match compiler? What happens if we can apply algorithm rules at the level of the method signature?
Yes learn some algorithms, then question why our programming languages limit how much we can put these great ideas into practice.
[+] [-] palish|14 years ago|reply
Clarifying, sorry.. could you elaborate a bit on what you meant by "games"?
[+] [-] kragen|14 years ago|reply
(There's some pretty good evidence that you can fill the spaces in between your practice sessions by practicing something else — without losing the benefit of spacing.)
The maze generation algorithms, though, are awesome.
My favorite is still this one by Joe Allen:
[+] [-] jamis|14 years ago|reply
[+] [-] Groxx|14 years ago|reply
[+] [-] robobenjie|14 years ago|reply
I actually used (yet another) maze generation algorithm for an xbox360 game I worked on as a school project. The constraints were slightly different because we wanted cycles and no dead ends.
You put all the cells in a list and take them out at random. If there are 3 or more walls, tear down walls until there are less than 3. When you are done you cannot have any dead ends because a dead end must have three walls. Of course you can have unconnected loops, so you have to go through and tear down walls to connect unconnected segments when you are done.
I don't know what my point is.
Mazes are neat.
[+] [-] icefox|14 years ago|reply
[+] [-] palish|14 years ago|reply
Thought I'd share too, don't have a point. :) graphics programming / dot product is neat.
Actually, there are some pretty fun graphics algorithms. I could ramble on about some, but don't want to intrude / doubt anyone cares but me, heh.
[+] [-] fl3tch|14 years ago|reply
Here's a tip for UX people: don't make anything flash more than 2 times per second. Also, "in the United States, websites provided by federal agencies are governed by section 508 of the Rehabilitation Act. The Act says that pages shall be designed to avoid causing the screen to flicker with a frequency greater than 2 Hz and less than 55 Hz." So that's the official recommendation.
[+] [-] kragen|14 years ago|reply
[+] [-] barrkel|14 years ago|reply
(Furthermore, I've never found learning about new algorithms to be taxing, and certainly never regarded it as a four-letter word.)
[+] [-] jamis|14 years ago|reply
[+] [-] Astrohacker|14 years ago|reply
[+] [-] Permit|14 years ago|reply
[+] [-] jarek|14 years ago|reply
[+] [-] code_duck|14 years ago|reply
[+] [-] AbyCodes|14 years ago|reply
So very true. The difference between the me one year back and the me now is that I know how and why certain things are the way they are. Understanding is enlightening.
Ultimately, it is that resistance you need to seek out. Look for things that will challenge you consistely (sic). Work at them until the resistance goes away, and then look for something new. That's how you'll grow your craft. That's what will make you better than you are today.
Amen.
[+] [-] dazbradbury|14 years ago|reply
"It is critical to remember that play is not exercise."
Focusing on what are you're good at (like algorithms for creating mazes), is in fact exercise. You're getting better at what you already consider yourself good at (assuming you don't stagnate - which I think the article is really getting at.)
Should you focus on weaknesses or strengths is a big debate, but strength finder (http://strengths.gallup.com/110440/About-StrengthsFinder-2.a...) seems like a popular camp.
[+] [-] angrycoder|14 years ago|reply
[+] [-] jashkenas|14 years ago|reply
[+] [-] ComputerGuru|14 years ago|reply
[+] [-] enobrev|14 years ago|reply
How is this different from having a separate page per slide? It seems we have the same result but with a better user experience. Isn't this a feature allowing each slide to be linkable? Why is this considered negative?
[+] [-] AshleysBrain|14 years ago|reply
[+] [-] dibarra|14 years ago|reply
[+] [-] fhars|14 years ago|reply
[+] [-] kragniz|14 years ago|reply
[+] [-] awolf|14 years ago|reply
[+] [-] Kafka|14 years ago|reply
I didn't like "It is critical to remember that play is not exercise." and to improve it I would like to add something like "But it's totally fine if your exercise feels like play. If your exercise is fun it's so much easier to do".
[+] [-] jwrnz|14 years ago|reply
no text at all in 1024x768
[+] [-] hmottestad|14 years ago|reply
[+] [-] savinos|14 years ago|reply
Also, since it's a computer science post :) I would have added time complexity, just for sake of completeness.
A big plus to the whole concept of "code kata".
Great stuff.
[+] [-] danso|14 years ago|reply
[+] [-] icebraining|14 years ago|reply
[+] [-] libria|14 years ago|reply
[+] [-] vanelsas|14 years ago|reply
Well done, loved it all the way!
[+] [-] capkutay|14 years ago|reply
You have a problem, so you suggest "I'll make an algorithm to solve it!"
...now you have 2 problems.
[+] [-] karinqe|14 years ago|reply
[+] [-] ckeen|14 years ago|reply
[+] [-] jamis|14 years ago|reply