loop diagramming tool?

Discussion in 'Mac Programming' started by mgsarch, Apr 16, 2008.

  1. macrumors regular

    Joined:
    Jan 19, 2008
    #1
    Is there a simple tool that will help diagram a program? Like, visual pseudo-coding kind of thing.

    I really want a little program that visualizes the data set created by for loops. I've never seen anything like that and I know it's pretty simple to set up a little spreadsheet but it would be so handy to have a little calculator that did that.
     
  2. macrumors 6502a

    yeroen

    Joined:
    Mar 8, 2007
    Location:
    Cambridge, MA
  3. thread starter macrumors regular

    Joined:
    Jan 19, 2008
    #3
    no, not a chart at all. it would perform more like a spreadsheet.

    eg.

    FOR Calculator

    Inputs: Starting Count Value, Test, Action

    for (int i = 0; i < 100; i++) {
    }


    Output: value for i at t0,t1,t2,t3 ... etc.

    This would be incredibly useful to me. I can easily output the numbers to the console of my IDE but it would be great to have a calculator that just did this and maybe saved to numbers/excel doc.

    It would be helpful because then I don't risk stupid infinite loops or other mistakes I'm bound to make and it also is good for helping explain how loops work.
     
  4. thread starter macrumors regular

    Joined:
    Jan 19, 2008
    #4
    It would be ridiculously easy to write this program, i guess i should just do it.
     
  5. macrumors 68000

    GeeYouEye

    Joined:
    Dec 9, 2001
    Location:
    State of Denial
    #5
    IIRC, there's actually a way to do this within Excel already, using macros.
     
  6. thread starter macrumors regular

    Joined:
    Jan 19, 2008
    #6
    hmm, interesting, i'm going to search, i'll post if i find.

    ty.
     
  7. macrumors G4

    Eraserhead

    Joined:
    Nov 3, 2005
    Location:
    UK
    #7
    I'd have thought this would be something a debugger could do, though I haven't used debuggers much at all.
     
  8. macrumors 6502a

    yeroen

    Joined:
    Mar 8, 2007
    Location:
    Cambridge, MA
    #8
    It sounds like printf() to stdout is all you need for this task
     

Share This Page