Code for reading in multiple sensors

I am working on a new product development class at OU where my team is designing a learning board for 3-8 year olds. We have the board completed but it was suggested that we add some sort of electronic component to make it more interesting for the children. It is sort of like plinko where a puck is dropped through as series (set up by the children) of shapes to guide the puck to a slot in the bottom of the board. The "problem" is a card with three pins that will connect to a breadboard on top of the unit. There are seven slots and seven proximity sensors located in the bottom of each. The arduino should read the pins in the card to tell it which slot has the correct answer, and when the puck breaks the correct sensor it will light up a series of LED's around the board as well as play a victory song on a pizeo speaker.

The problem I am having is writing the code. I have very limited experience with arduino, but I have some. I am reading the sensors in on pins D13 through D7. I have the lights and speaker on D6 and D5. D2, D1, and D0 will be connected to read the pins.

The problem card has three pins in each one. One will read in as the number 4, the next the number 2, and the last, the number 1. Depending on which ones are grounded, I can read in 1-7. Below is my code (and my notes). I can program the lights and the buzzer, but I cannot figure out how to "connect" the sensor to the integer I get from the card.

Any help is greatly appreciated.

void setup() {
// put your setup code here, to run once:
//Read Pins
pinMode(13, INPUT);
pinMode(12, INPUT);
pinMode(11, INPUT);
pinMode(10, INPUT);
pinMode(9, INPUT);
pinMode(8, INPUT);
pinMode(7, INPUT);
pinMode(6, OUTPUT);
pinMode(5, OUTPUT);
pinMode(2, OUTPUT);
pinMode(1, OUTPUT);
pinMode(0, OUTPUT);
int f1;
int f2;
int f3;
bool fLand = false;
bool fB0;
bool fB1;
bool fB2;
bool fB3;
bool fB4;
bool fB5;
bool fB6;
int Answer = f1 + (2 * f2) + (4 * f4); // equals 0-7. These are the pins. Set low when tripped high they

are 1,
// set low (not connected)they are low and will return a zero. This
should give me my integer to show the program which slot is correct.

}

void loop() {
// put your main code here, to run repeatedly:

if fLand // Breaks a sensor
{
fcorrect = fB0 && ans == 0 || fB1 && ans == 1 || fB2 && ans = 2 || fB3 && ans == 3 || fB4 && ans == 5 || fB5 && ans == 6
// lights and buzzer
}
else
{
// Buzzer wrong

You are going to need some digitalRead statements in your code to read the pins. Your use of pinMode to set some of them as inputs is fine as far as it goes, but it doesn't automatically read them.

Similarly, this piece of code may be another misconception:

int Answer = f1 + (2 * f2) + (4 * f4); // equals 0-7.  These are the pins.  Set low when tripped high they

When that runs, Answer will be zero and will be forever more. I suspect that you're hoping that as f1 f2 and f4 change (not that they will with the code you have so far) that Answer will change with them - it won't - you need to explicitly recalculate it.

You might want to learn some more C to find out about arrays for one.

Also learn about bits, bit logic and bit manipulation.

Depending on what board you use, you can put 6 to 8 digital sensors on the pins of 1 port and read them all at once in a single cycle.

So the puck drops and the port reads 32 (bit 5 where 8 bits are bit 0 to bit 7, we don't start at 1 we start at 0), the 3 pins with the right answer (can be 0 to 7, 3 bits is an octal digit) of binary 110 would be a match and any other would not.

If you feel lost it's because you are missing a good deal of basic knowledge needed. That's a great way to get nowhere fast.