|
|
@ -1,46 +0,0 @@
|
|
|
|
using System;
|
|
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
namespace Models
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
public class GrilleOperation
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
public bool[,] Carreaux;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public GrilleOperation()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Carreaux = new bool[5,4];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void ResultatGrille(Operation p)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
switch (p)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
case Operation.INFERIEUR:
|
|
|
|
|
|
|
|
for (int i = 0; i < Carreaux.GetLength(1); i++) { if (Carreaux[0, i] == false) { Carreaux[0, i] = true; return; } }
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
case Operation.SUPERIEUR:
|
|
|
|
|
|
|
|
for (int i = 0; i < Carreaux.GetLength(1); i++) { if (Carreaux[1, i] == false) { Carreaux[1, i] = true; return; } }
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
case Operation.SOUSTRACTION:
|
|
|
|
|
|
|
|
for (int i = 0; i < Carreaux.GetLength(1); i++) { if (Carreaux[2, i] == false) { Carreaux[2, i] = true; return; } }
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
case Operation.ADDITION:
|
|
|
|
|
|
|
|
for (int i = 0; i < Carreaux.GetLength(1); i++) { if (Carreaux[3, i] == false) { Carreaux[3, i] = true; return; } }
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
case Operation.MULTIPLICATION:
|
|
|
|
|
|
|
|
for (int i = 0; i < Carreaux.GetLength(1); i++) { if (Carreaux[4, i] == false) { Carreaux[4, i] = true; return; } }
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|