How to set the initial sumComp value, sumHum to zero, now each time you press the button displays large numbers (<16000)
procedure TForm1.Button1Click(Sender: TObject); var hDice, cDice:shortint; sumComp, sumHum: integer; begin Randomize; hDice :=random(6); cDice :=random(6); Label1.Caption := IntToStr(hDice+1); Label2.Caption := IntToStr(cDice+1); ... sumComp := sumComp+cDice; sumHum := sumHum+hDice; Label6.Caption:=IntToStr(sumComp);
sumComp,sumHumclass fields - Anton Shchyrov