CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Threaded View

  1. #1
    Join Date
    Sep 2010
    Posts
    14

    Creating basic road for traffic simulator

    Hi
    I need to create a cellular automation model of traffic flow. The program will have a 1D road which will contain a user entered amount of cars which are represented on the road as a 1 or 0.

    I need to know how to use the paint() method to create a rectangle with lines which seperate it into cells, I attatched an image of what I mean.

    Also, how would I populate each cell with a number? I have a method which has an int array which represents the road and then a forumula which calculates each value ( 1 or 0) for the cell of the road but I do not know how to display this information using paint().

    Thanks
    Attached Images Attached Images

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured