Thread: 4 sensors programm

  1. #1
    Registered User
    Join Date
    Jan 2012
    Posts
    6

    4 sensors programm

    i have to solve a programm that has 4 sensors series.there is an array 10x15
    with black and white cells like this 4 sensors programm-png
    the challenge is to make a programm that take as entrance a file with the result of 4 sensor seiries (black cells sensor translate as 1 ,and the white cells sensor translate as 0,so every sensor(73 totaly) give a number of the sum of ones(1) ,and the numbers are this result.
    10 10 6 4 6 8 13 15 11 6 ///1 seiries of sensors
    0 1 2 2 2 2 4 5 5 6 7 6 5 6 6 5 5 6 6 3 2 2 1 0///2 seiries of sensors
    2 4 5 5 7 6 7 10 10 10 7 3 3 5 5///3 seiries of sensors
    0 0 1 3 4 4 4 4 3 4 5 7 8 8 9 9 6 4 4 2 0 0 0 0///4 series of sensors
    the exit φιλε should be a file like this
    .##########....
    .##########....
    ....######.....
    ......####.....
    .......####..##
    .......########
    #####..########
    ###############
    ..#########..##
    ....######..... (the 1 correspond to '#' and 0 to '.'
    i really need a idea of who sensors should be.

  2. #2
    Registered User
    Join Date
    Dec 2011
    Posts
    795
    What have you done so far? Even if it's just allocating the arrays, we need to see that you're putting forth some effort before helping you.

  3. #3
    Registered User
    Join Date
    Jan 2012
    Posts
    6
    i need help how this 73 sensors works.if only every sensor knows the sum of ones.i havent done something yet because i dont understand the logic

  4. #4
    Registered User
    Join Date
    Dec 2011
    Posts
    795
    Then why do you expect help for doing absolutely nothing? I still can't understand exactly what you want because your posts make no sense... but anyway....

    It's fine if you don't understand the logic, but there's still a lot you could do. First, you know that the program will use a 15x10 array, right? You also know that it will open a file, and write to a file. That doesn't take any complex logic, so, you can set that up and post it.

    For the actual sensor reading, you'll have to dissect whatever format it's in, and then programatically parse it, but we'd be glad to help you with that (provided you used Google first).

  5. #5
    Registered User
    Join Date
    Jan 2009
    Posts
    1,485
    Can't you just store the correct pattern of '#' and '.' in a 73 byte array, then read in 73 bytes from disk and do a memcmp()?

  6. #6
    Registered User
    Join Date
    Jan 2012
    Posts
    6
    no,because this is the point of the programm,to produce the pattern of '#' and '.' .memcyp you have right i have to start with the simple things first

  7. #7
    Registered User
    Join Date
    Jan 2009
    Posts
    1,485
    Ok, but how are you suppose to know where on the line the 1s are? Let's say the first sensor produce 6. It does not tell you about the layout on the row of 15 possible slots.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. How can i run a programm ?
    By Shirali in forum C++ Programming
    Replies: 3
    Last Post: 03-29-2009, 02:05 AM
  2. temperature sensors
    By danko in forum C Programming
    Replies: 22
    Last Post: 07-10-2007, 07:26 PM
  3. Sensors
    By kavanakt in forum Networking/Device Communication
    Replies: 4
    Last Post: 10-11-2005, 12:41 AM
  4. angular sensors
    By ygfperson in forum Tech Board
    Replies: 1
    Last Post: 11-28-2002, 06:11 PM
  5. different types of sensors
    By Shadow12345 in forum C++ Programming
    Replies: 3
    Last Post: 07-24-2002, 05:46 PM