janko metelko wrote:

> I would love to see how the idiomatic factor of this would look like.

I took the internal defines version to the extreme. The main body is now:

            ball-in-bounds?
              [
                align-paddle-with-mouse

                move-ball                
  
                computer-reaction
                
                player-blocked-ball?   [ bounce-off-player-paddle    ] when
                computer-blocked-ball? [ bounce-off-computer-paddle  ] when
                bounce-off-wall?       [ reverse-horizontal-velocity ] when
                
                draw-computer-paddle
                draw-player-paddle
                draw-ball
              ]
            when

That's working code by the way. I think it would get the Leo Brodie seal of 
approval. :-)

http://paste.factorcode.org/paste?id=197

Ed

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Factor-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to