help with dice game code

I have 2 7-segment display and I need them to display an animation when the PB is pressed and then display a random number between 1-6 on each 7-seg display. Can someone help me with the display of the random numbers. I have a PNP and a NPN transistors to be able to switch from one display to the other. The code is commented below

sketch_nov12a.ino (2.75 KB)

People are reluctant to download a file, even if it looks like a code file. Instead, read the posts at the top of this Forum, including the one that tells you how to use code tags to list your program here.

//Functions 
void Dice();
void Dice2();
byte number[] = {0X02,0X12,0X19,0X30,0X24,0X79};
int dice1 = rollDice();

// The setup routine runs once when you press reset:
void setup() {  
  pinMode(0, OUTPUT);              
  pinMode(1, OUTPUT);  
  pinMode(2, OUTPUT);  
  pinMode(3, OUTPUT);  
  pinMode(4, OUTPUT);  
  pinMode(5, OUTPUT);  
  pinMode(6, OUTPUT);  
  pinMode(7, OUTPUT);  
  pinMode(8, INPUT_PULLUP);

  randomSeed(analogRead(0));
}
 
// The loop routine runs over and over again forever:
void loop() {
  delay(500);

//Dices animation
  while(digitalRead(8)==HIGH){
  digitalWrite(0,LOW);
  Dice();
  dice1();
  delay(10);
  digitalWrite(0,HIGH);
  Dice2();
  delay(10);
}
}

byte rollDice(){
  byte randNumber; 
  randNumber = random(1,7);
  return randNumber;
}
void Dice(){
  digitalWrite(1, HIGH);
  digitalWrite(2, HIGH);
  digitalWrite(3, HIGH);
  digitalWrite(4, HIGH);
  digitalWrite(5, LOW);
  digitalWrite(6, HIGH);
  digitalWrite(7, HIGH);
  delay(80);
  digitalWrite(1, HIGH);
  digitalWrite(2, HIGH);
  digitalWrite(3, HIGH);
  digitalWrite(4, HIGH);
  digitalWrite(5, HIGH);
  digitalWrite(6, LOW);
  digitalWrite(7, HIGH);
  delay(100);
  digitalWrite(1, LOW);
  digitalWrite(2, HIGH);
  digitalWrite(3, HIGH);
  digitalWrite(4, HIGH);
  digitalWrite(5, HIGH);
  digitalWrite(6, HIGH);
  digitalWrite(7, HIGH);
  delay(100);
  digitalWrite(1, HIGH);
  digitalWrite(2, LOW);
  digitalWrite(3, HIGH);
  digitalWrite(4, HIGH);
  digitalWrite(5, HIGH);
  digitalWrite(6, HIGH);
  digitalWrite(7, HIGH);
  delay(80);
  digitalWrite(1, HIGH);
  digitalWrite(2, HIGH);
  digitalWrite(3, LOW);
  digitalWrite(4, HIGH);
  digitalWrite(5, HIGH);
  digitalWrite(6, HIGH);
  digitalWrite(7, HIGH);
  delay(100); 
}

void Dice2(){
  digitalWrite(1, HIGH);
  digitalWrite(2, LOW);
  digitalWrite(3, HIGH);
  digitalWrite(4, HIGH);
  digitalWrite(5, HIGH);
  digitalWrite(6, HIGH);
  digitalWrite(7, HIGH);
  delay(80);
  digitalWrite(1, HIGH);
  digitalWrite(2, HIGH);
  digitalWrite(3, LOW);
  digitalWrite(4, HIGH);
  digitalWrite(5, HIGH);
  digitalWrite(6, HIGH);
  digitalWrite(7, HIGH);
  delay(100);
  digitalWrite(1, HIGH);
  digitalWrite(2, HIGH);
  digitalWrite(3, HIGH);
  digitalWrite(4, LOW);
  digitalWrite(5, HIGH);
  digitalWrite(6, HIGH);
  digitalWrite(7, HIGH);
  delay(100);
  digitalWrite(1, HIGH);
  digitalWrite(2, HIGH);
  digitalWrite(3, HIGH);
  digitalWrite(4, HIGH);
  digitalWrite(5, LOW);
  digitalWrite(6, HIGH);
  digitalWrite(7, HIGH);
  delay(100);
  digitalWrite(1, HIGH);
  digitalWrite(2, HIGH);
  digitalWrite(3, HIGH);
  digitalWrite(4, HIGH);
  digitalWrite(5, HIGH);
  digitalWrite(6, LOW);
  digitalWrite(7, HIGH);
  delay(100);
}

There's definitely some restructuring you could do to redesign and clean up your code (abstract out the animation loop you're doing to iterate over an array of set display sequences so that you don't have to write it all out/easier to modify, change your 'roll' event from something that blocks the loop to something that updates each loop cycle, better function names), but it seems like you're on a workable track provided your circuit's working fine. As far as debugging goes it looks like you're still working on displaying a specific digit on your display, is that where you're stuck?

yes, I have my animation but when I release the PB the animation stops but no numbers are displayed.