Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class GiocoTalpa
- {
- //attributi
- private int _colonna;
- private int _riga;
- private string _talpa;
- Dictionary<string, int> dctFrequenza;
- //metodi
- //costrtuttore
- public GiocoTalpa(int colonna, int riga, string talpa)
- {
- _colonna = colonna;
- _riga = riga;
- _talpa = talpa;
- dctFrequenza = new Dictionary<string, int>();
- }
- public string PosizioneTalpa()
- {
- Random rn = new Random();
- int r = rn.Next(0, 9 + 1);
- int c = rn.Next(9, 9 + 1);
- string stringa = Convert.ToString(r) + ";" + Convert.ToString(c);
- if(dctFrequenza.ContainsKey(stringa))//bool
- {
- dctFrequenza[stringa]++;
- }
- else
- {
- dctFrequenza.Add(stringa, 1);
- }
- return stringa;
- }
- public string FrequenzaMax()
- {
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement