Question on a 2x2x2 LED cube?

Hello i haven’t build a led cube in a while almost a year so thought i make one i found a simple 2x2x2 led cube single color using the uno board but was wondering how i can make it work on a attiny85 chip that only haves 5 pins but the code needs 6 can someone please help me out? the sketch is also below as to where i found the cube at.

website i found it at is Arduino 2x2x2 LED Cube with code - YouTube

int ledpins[] = {3,5,6,9};
int groundpins[] = {12,13};
void setup ()
{
  for(int i = 0; i < 4; i++)
  {        
      pinMode(ledpins[i],OUTPUT); 
  }                          
  for (int i= 0; i<2; i++)
  {pinMode(groundpins[i],OUTPUT);}

}

void loop()
{
 twist();
 drop();
 diagonal();
}

void twist()
{
  int delaytime=100;
   digitalWrite(groundpins[0], HIGH);
    delay(100);   
  digitalWrite(ledpins[0], HIGH);  
  delay(delaytime);                
  digitalWrite(ledpins[1], HIGH);  
  delay(delaytime);                
  digitalWrite(ledpins[2], HIGH);  
  delay(delaytime);                
  digitalWrite(ledpins[3], HIGH);
  delay(delaytime);
  
   digitalWrite(ledpins[0], LOW);  
  delay(delaytime);                
  digitalWrite(ledpins[1], LOW);  
  delay(delaytime);                
  digitalWrite(ledpins[2], LOW);  
  delay(delaytime);                
  digitalWrite(ledpins[3], LOW);  
 delay(delaytime);
 digitalWrite(groundpins[0], LOW);
 
 
 
 
 digitalWrite(groundpins[1], HIGH);
    delay(100);   
  digitalWrite(ledpins[1], HIGH);  
  delay(delaytime);                
  digitalWrite(ledpins[2], HIGH);  
  delay(delaytime);                
  digitalWrite(ledpins[3], HIGH);  
  delay(delaytime);                
  digitalWrite(ledpins[0], HIGH);
  delay(delaytime);
  
   digitalWrite(ledpins[1], LOW);  
  delay(delaytime);                
  digitalWrite(ledpins[2], LOW);  
  delay(delaytime);                
  digitalWrite(ledpins[3], LOW);  
  delay(delaytime);                
  digitalWrite(ledpins[0], LOW);  
  delay(delaytime);
  digitalWrite(groundpins[1], LOW);
  
  
  digitalWrite(groundpins[0], HIGH);
    delay(100);   
  digitalWrite(ledpins[2], HIGH);  
  delay(delaytime);                
  digitalWrite(ledpins[3], HIGH);  
  delay(delaytime);               
  digitalWrite(ledpins[0], HIGH); 
  delay(delaytime);                
  digitalWrite(ledpins[1], HIGH);
  delay(delaytime);
  
  digitalWrite(ledpins[2], LOW);  
  delay(delaytime);                
  digitalWrite(ledpins[3], LOW);  
  delay(delaytime);                
  digitalWrite(ledpins[0], LOW);  
  delay(delaytime);                
  digitalWrite(ledpins[1], LOW);  
  delay(delaytime);
  digitalWrite(groundpins[0], LOW);
  
  digitalWrite(groundpins[1], HIGH);
    delay(100);   
  digitalWrite(ledpins[3], HIGH);  
  delay(delaytime);                
  digitalWrite(ledpins[0], HIGH);  
  delay(delaytime);                
  digitalWrite(ledpins[1], HIGH);  
  delay(delaytime);                
  digitalWrite(ledpins[2], HIGH);
  delay(delaytime);
  
  digitalWrite(ledpins[3], LOW);  
  delay(delaytime);               
  digitalWrite(ledpins[0], LOW);  
  delay(delaytime);                
  digitalWrite(ledpins[1], LOW);  
  delay(delaytime);                
  digitalWrite(ledpins[2], LOW);  
  delay(delaytime);
  digitalWrite(groundpins[1], LOW);
}

void drop()
{
  int dtime = 75;
  digitalWrite(groundpins[0], HIGH);
  digitalWrite(ledpins[0], HIGH);
  delay(dtime);
  digitalWrite(groundpins[0], LOW);
  digitalWrite(groundpins[1],HIGH);
  delay(dtime);
  digitalWrite(groundpins[1], LOW);
  digitalWrite(ledpins[0], LOW);
  
  digitalWrite(groundpins[0], HIGH);
  digitalWrite(ledpins[1], HIGH);
  delay(dtime);
  digitalWrite(groundpins[0], LOW);
  digitalWrite(groundpins[1], HIGH);
  delay(dtime);
  digitalWrite(groundpins[1], LOW);
  digitalWrite(ledpins[1], LOW);
  
  digitalWrite(groundpins[0], HIGH);
  digitalWrite(ledpins[2], HIGH);
  delay(dtime);
  digitalWrite(groundpins[0], LOW);
  digitalWrite(groundpins[1], HIGH);
  delay(dtime);
  digitalWrite(groundpins[1], LOW);
  digitalWrite(ledpins[2], LOW);
  
   digitalWrite(groundpins[0], HIGH);
  digitalWrite(ledpins[3], HIGH);
  delay(dtime);
  digitalWrite(groundpins[0], LOW);
  digitalWrite(groundpins[1], HIGH);
  delay(dtime);
  digitalWrite(groundpins[1], LOW);
  digitalWrite(ledpins[3], LOW);
  
  
  //second time down
  digitalWrite(groundpins[0], HIGH);
  digitalWrite(ledpins[0], HIGH);
  delay(dtime);
  digitalWrite(groundpins[0], LOW);
  digitalWrite(groundpins[1],HIGH);
  delay(dtime);
  digitalWrite(groundpins[1], LOW);
  digitalWrite(ledpins[0], LOW);
  
  digitalWrite(groundpins[0], HIGH);
  digitalWrite(ledpins[1], HIGH);
  delay(dtime);
  digitalWrite(groundpins[0], LOW);
  digitalWrite(groundpins[1], HIGH);
  delay(dtime);
  digitalWrite(groundpins[1], LOW);
  digitalWrite(ledpins[1], LOW);
  
  digitalWrite(groundpins[0], HIGH);
  digitalWrite(ledpins[2], HIGH);
  delay(dtime);
  digitalWrite(groundpins[0], LOW);
  digitalWrite(groundpins[1], HIGH);
  delay(dtime);
  digitalWrite(groundpins[1], LOW);
  digitalWrite(ledpins[2], LOW);
  
   digitalWrite(groundpins[0], HIGH);
  digitalWrite(ledpins[3], HIGH);
  delay(dtime);
  digitalWrite(groundpins[0], LOW);
  digitalWrite(groundpins[1], HIGH);
  delay(dtime);
  digitalWrite(groundpins[1], LOW);
  digitalWrite(ledpins[3], LOW);
  
  
}
 
void diagonal()
{
 int dtime= 100;
 //bottom pin 0 on
 digitalWrite(groundpins[1], HIGH);
 digitalWrite(ledpins[0], HIGH);
 delay(dtime);
 //bottom pin 0 off
 digitalWrite(groundpins[1], LOW);
 digitalWrite(ledpins[0], LOW);
 delay(dtime);
 //top pin 1 on
 digitalWrite(groundpins[0], HIGH);
 digitalWrite(ledpins[1], HIGH);
 delay(dtime);
 //top pin 1 off
 digitalWrite(groundpins[0], LOW);
 digitalWrite(ledpins[1], LOW);
 //bottom pin 2 on
 digitalWrite(groundpins[1], HIGH);
 digitalWrite(ledpins[2], HIGH);
 delay(dtime);
 //bottom pin 2 off
 digitalWrite(groundpins[1], LOW);
 digitalWrite(ledpins[2], LOW);
  //top pin 3 on
 digitalWrite(groundpins[0], HIGH);
 digitalWrite(ledpins[3], HIGH);
 delay(dtime);
 //top pin 3 off
 digitalWrite(groundpins[0], LOW);
 digitalWrite(ledpins[3], LOW);
 
 
 
 
 
 //top pin 0 on
 digitalWrite(groundpins[0], HIGH);
 digitalWrite(ledpins[0], HIGH);
 delay(dtime);
 //top pin 0 off
 digitalWrite(groundpins[0], LOW);
 digitalWrite(ledpins[0], LOW);
 delay(dtime);
 //bottom pin 1 on
 digitalWrite(groundpins[1], HIGH);
 digitalWrite(ledpins[1], HIGH);
 delay(dtime);
 //bottom pin 1 off
 digitalWrite(groundpins[1], LOW);
 digitalWrite(ledpins[1], LOW);
 //top pin 2 on
 digitalWrite(groundpins[0], HIGH);
 digitalWrite(ledpins[2], HIGH);
 delay(dtime);
 //top pin 2 off
 digitalWrite(groundpins[0], LOW);
 digitalWrite(ledpins[2], LOW);
  //bottom pin 3 on
 digitalWrite(groundpins[1], HIGH);
 digitalWrite(ledpins[3], HIGH);
 delay(dtime);
 //bottom pin 3 off
 digitalWrite(groundpins[1], LOW);
 digitalWrite(ledpins[3], LOW);
 
 }

You can use a shift register, they only need three pins, clock, data and latch.

Another option is charlieplexing.

I just thought of something i also have a attiny84 with 11 pin outs on it. might be better i just looked and had 2.