RE: Help with Simple Graphics Demo

new topic     » goto parent     » topic index » view thread      » older message » newer message

euphoric wrote:
> Brian, where did I screw this up? It's not drawing the complete lines... 
> 
> only the tops. And even some are not being drawn. :/


A quick look reveals that the heart of the bar drawing is no longer a 
nested loop as it should be...

    for i = 1 to dice_rolls do
      roll = 0
      for j = 1 to dice_num do
        roll += rand( dice_sides )
      end for
      slot = roll-dice_num+1
      dice_results[slot] += 1
      setPenColor( Graph, Black )
      drawLine(Graph,30*(slot)-30,graph_size[2]-20-dice_results[slot],
                     30*(slot)-20,graph_size[2]-20-dice_results[slot])
      copyBlt(Window1,8,84,Graph)
    end for

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu