will this work on a attiny45

hi there will this work on a attiny45 be for i purchase one?

// digital
const int led2    = 0;
const int led3    = 1 ;
// analog
int knockinput    = 3 ;
int led1    =       2 ;


//       attiny45 / attiny85
//
//             +-\/-+
//      Reset 1|    |8 Vcc
//      (A 3) 2|    |7 (A 1) 
//      (A 2) 3|    |6 (D 1) PWM1
//        GND 4|    |5 (D 0) PWM0
//             +----+

void setup() {
  pinMode(led2,   OUTPUT);    
  pinMode(led3,   OUTPUT);

}

void loop() {
    int val = analogRead(knockinput);
    if (val >256) {
      analogWrite(led1,   255);
    }
    else {
      analogWrite(led1,   0);
    }
    //------------------------------
    if (val >512) {
      digitalWrite(led2,   HIGH);
    }
    else {
      digitalWrite(led2,   LOW);
    }
    //-------------------------------
    if (val >768) {
      digitalWrite(led3,   HIGH);
    }
    else {
      digitalWrite(led3,   LOW);
    }
}

Yes it will, given that the the correct digital and analog pins are used. You may need to change the variable definitions for led2, led3 on the top of the code. The ATtiny45 can handle all those functions.