Loading LettereRandom/LettereRandom/MainWindow.xaml.cs +23 −0 Original line number Diff line number Diff line Loading @@ -16,9 +16,32 @@ namespace LettereRandom /// </summary> public partial class MainWindow : Window { private Random rnd = new Random(); private bool inizioCasualitàLettere = true; private string parolaCorrente = string.Empty; private int lunghezzaMassima = 0; public MainWindow() { InitializeComponent(); InizioLoopLettere(); } private async void InizioLoopLetere() { while (inizioCasualitàLettere) { // Tabella ASCII: A = 65, Z = 90 char letteraCasuale = (char)rnd.Next('A', 'Z' + 1); // +1 perché il secondo parametro è escluso lblLettera.Content = letteraCasuale.ToString(); await Task.Delay(100); } } } } No newline at end of file Loading
LettereRandom/LettereRandom/MainWindow.xaml.cs +23 −0 Original line number Diff line number Diff line Loading @@ -16,9 +16,32 @@ namespace LettereRandom /// </summary> public partial class MainWindow : Window { private Random rnd = new Random(); private bool inizioCasualitàLettere = true; private string parolaCorrente = string.Empty; private int lunghezzaMassima = 0; public MainWindow() { InitializeComponent(); InizioLoopLettere(); } private async void InizioLoopLetere() { while (inizioCasualitàLettere) { // Tabella ASCII: A = 65, Z = 90 char letteraCasuale = (char)rnd.Next('A', 'Z' + 1); // +1 perché il secondo parametro è escluso lblLettera.Content = letteraCasuale.ToString(); await Task.Delay(100); } } } } No newline at end of file