Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tag: procedural

Dec 07, 2011

  1. Steve Klabnik

    Implement automated solver.

    We go from an 'choose your own adventure' style to an automatic
    solver.
    
    And let's make some comments, show them an example of what we're
    doing and why. Always like to link to the definition of the type I'm
    working with, makes it a lot easier.
    authored December 05, 2011
  2. Steve Klabnik

    Adding winning message.

    What kind of game doesn't congratulate you when you win?
    authored December 07, 2011
  3. Steve Klabnik

    Leaving!

    This time, since it really goes inside that loop, I built it as a
    method from the beginning. Most of the implementation is the same as
    extract_href_from_xml. Sweet.
    authored December 07, 2011
  4. Steve Klabnik

    Accepting input for the game.

    Doing this kind of dispatch feels ugly, but since the end goal is
    automated maze solving, I'm doing it anyway.
    
    Also, exit revealed something quite interesting. Can't name a variable
    'exit', or else it quits Ruby. hahahaha!
    
    Oh, and you can't actually exit yet. Guess what I'm doing next...
    authored December 07, 2011
  5. Steve Klabnik

    Extracting directions.

    Since these are the exact same, I did them all at the same time too.
    
    Now we print out which directions we can go in in the current room. You
    gotta hit control-c to break out, and you don't go anywhere. Whatever.
    authored December 07, 2011
  6. Steve Klabnik

    Wrap up that href extraction.

    My Ruby style tends to be of the 'zillions of tiny methods' variety. So
    I wrap up _everything_ as methods, even if I'll only use them once, for
    clarity. This time I did two at once, because I'm impatient and one of
    them is only two lines. I got lucky...
    
    Developing software is all about discipline. You don't _have_ to follow
    best practices, but it's always those times that come back to bite you
    in the end.
    authored December 07, 2011
  7. Steve Klabnik

    Fetch start of maze.

    First thing we need to do is grab the @start link. We'll use nokogiri
    to parse that out. Pretty simple.
    authored December 07, 2011
  8. Steve Klabnik

    Wrapping up Net::HTTP.

    Now that I have that working, I want to make a method that I can use. I
    take these steps really slow, _especially_ since I'm being bad and
    doing this without tests. It's just exploratory programming...
    
    Everyone says that in their first few commits, anyway.
    authored December 07, 2011
  9. Steve Klabnik

    Requesting XML with Net::HTTP.

    First off, I wanted to figure out how the hell to use Net::HTTP. It
    never fails, I always forget. I did a google search for 'request
    headers net::http ruby' and came up with the documentation, which had
    an example I modified to get this.
    
    If you run it, you can see the initial maze XML come back. Awesome.
    authored December 07, 2011
  10. Steve Klabnik

    Adding dotfiles.

    I often like to start out a project with a .gitignore and a .rvmrc.
    Documenting which Ruby you're using is a good start, and I hate
    accidentally adding vim's swapfiles into my repos.
    authored December 07, 2011
  11. Steve Klabnik

    initial commit

    authored December 07, 2011
Something went wrong with that request. Please try again.