Je cherche à générer une phrase aléatoirement via un script en JS. Le plus simple possible.
Je ne comprends pas comment intégrer correctement le script pour le rendre fonctionnel.
Le voici: const
SentencesCountMax = 8;
Sentences : array[0..TACountMax-1] of string = (
'Bonjour!',
'Salut!',
'Coucou!',
'Salutation!',
'Hi!',
'Hello',
'''Lut!',
'Yo!'
);
var
CurrentSentence : integer = 0;
procedure TForm1.Button1Click(Sender: TObject);
begin
Edit3.Text := Sentences[CurrentSentence];
CurrentSentence := (CurrentSentence+1) mod SentencesCountMax;
end;
<hr size="2" width="100%" />