Find the common bugs!

Common hardware bugs:

Tracking down software bugs (after all the syntax errors are out!)

weird results wrong output nothing happening
int s = 0;     // state
int pin1=13;
int pin2=12;
int pin3=11;
int inpin=10;
// declare pins for input and output 
//     ( 1 input pin, 3 output pins)
void setup ( ){
    // setup the input and output pins
    pinMode(inpin,OUTPUT);
    pinMode(pin1,INPUT);
    pinMode(pin2,INPUT);
    pinMode(pin3,INPUT);
}
void loop( ){
      s++;
      digitalWrite(pin3, HIGH);
      if ( s == 1 ){ //display 1
          digitalWrite(pin1, LOW);
          digitalWrite(pin2,LOW);
      }
      if (s == 2) { // display 3
         digitalWrite(pin1, LOW);
        digitalWrite(pin2,HIGH);
        s=0;
      }
}
int pin1=1;
int pin2=2;
int pin3=3;
int inpin=4;

void setup ( ){
     pinMode(inpin,INPUT);
     pinMode(pin1,OUTPUT);
     pinMode(pin1,OUTPUT);
     pinMode(pin1,OUTPUT);
}

void loop( ){
     digitalWrite(pin3, HIGH);  
     digitalWrite(pin1, LOW);
     digitalWrite(pin2,LOW);
}
        

int s = 0;     // state
int in = 0;    // input
int next = 0;  // next state
int pin1=7;
int pin2=8;
int pin3=9;
int inpin=10;

void setup ( ){
    // setup the input and output pins
    Serial.begin(9600); // ready to print for debugging
    pinMode(inpin,INPUT);
    pinMode(pin1,OUTPUT);
    pinMode(pin2,OUTPUT);
    pinMode(pin3,OUTPUT);
}
void loop( ){
   showValue( );
   if ( s == 0 && in == 1) next = 1;
   if ( s == 1 && in == 0) next = 0;
   if ( s == 1 && in == 1) next = 2;
   if ( s ==2 && in == 0) next = 1;
   s = next; // get ready for the next step
   delay(2000);
}
void showValue( ){
    // assume the code is here to show each value
}
        

Tracing code

void loop( ){
   showValue( );
     if ( s == 0 && in == 0) next = 0;
     if ( s == 0 && in == 1) next = 1;
     if ( s == 1 && in == 0) next = 0;
     if ( s == 1 && in == 1) next = 2;
     if ( s ==2 && in == 0) next = 1;
     if ( s == 2 && in == 1) next = 2;
   s = next; // get ready for the next step
   Serial.print("next s=");
   Serial.println(s);
   Serial.print("input = ");
   Serial.println(in);
   Serial.println(" ");
   delay(2000);