Documente Academic
Documente Profesional
Documente Cultură
Model Documentatie Atestat
Model Documentatie Atestat
BETEL
Atestat la informatică
SOLAR ENERGY
2024
Oradea
CUPRINS
Introducere………………………................……... 3
Prezentarea aplicaţiei………………................….. 4
Utilizarea aplicaţiei……………………….............. 5
Cod sursă………………………………..............… 6
Bibliografie……………………………...............… 9
2
INTRODUCERE
Prin acest site, imi propun să vă port în fascinanta lume a energiei solare, să vă
ofer informații esențiale, să vă inspir și să vă ghidez în explorarea acestui domeniu în
continuă expansiune.
3
PREZENTAREA APLICAŢIEI
4
UTILIZAREA APLICAŢIE
5
La apasarea butonului ”cum sa joc?” apare urmatoarea casuţă cu specificaţiile necesare:
COD SURSĂ
Codul este insotit cu comentari pentru a usura intelegerea lui.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace tic_tac_toe
{
public partial class Form1 : Form
{
bool turn = true; // true = randul lui X
int turn_count = 0;
public Form1()
{
InitializeComponent();
}
6
private void cumSaJocToolStripMenuItem_Click(object sender, EventArgs e)
{
MessageBox.Show("X și O (engleză tic-tac-toe) este un joc pentru doi jucători,
'X' respectiv '0', care marchează pe rând câte o căsuță dintr-un tabel cu 3 linii și 3
coloane. Jucătorul care reușește primul să marcheze 3 căsute adiacente pe orizontală,
verticală sau diagonală caștigă jocul.", "cum sa joc?");
}
// Am folosit Messagebox.Show pentru a afisa instructiunile la un simplu click
// ORIZONTALA
if ((A1.Text == A2.Text) && (A2.Text == A3.Text)&& (!A1.Enabled))
castigator = true;
if ((B1.Text == B2.Text) && (B2.Text == B3.Text) && (!B1.Enabled))
castigator = true;
if ((B1.Text == B2.Text) && (B2.Text == B3.Text) && (!C1.Enabled))
castigator = true;
// VERTICALA
if ((A1.Text == B1.Text) && (B1.Text == C1.Text) && (!A1.Enabled))
castigator = true;
if ((A2.Text == B2.Text) && (B2.Text == C2.Text)&& (!A2.Enabled))
castigator = true;
if ((A3.Text == B3.Text) && (B3.Text == C3.Text) && (!A3.Enabled))
castigator = true;
//DIAGONALA
if ((A1.Text == B2.Text) && (B2.Text == C3.Text) && (!A1.Enabled))
castigator = true;
if ((A3.Text == B2.Text) && (B2.Text == C1.Text) && (!A3.Enabled))
castigator = true;
if (castigator) //afiseaza
{
disableButtons();
7
String winner = "";
if (turn)
{
winner = "O"; //afisarea castigatorului
ovictorii.Text = (Int32.Parse(ovictorii.Text) + 1).ToString();
// punctajul
}
else
{
winner = "X";
xvictorii.Text = (Int32.Parse(xvictorii.Text) + 1).ToString();
}
MessageBox.Show(winner + " a invins!", "Yay!");
}
else
{
if (turn_count == 9) //remiza
{
remize.Text = (Int32.Parse(remize.Text) + 1).ToString();
MessageBox.Show(" remiza :(", "off..");
}
}
} // final VerificaCastigatorul
8
}
} //joc nou
}
}
9
BIBLIOGRAFIE
1. https://blogs.msdn.microsoft.com/visualstudio/2015/07/20/visual-studio-2015-and-
visual-studio-2013-update-5-released/
2. https://ro.wikipedia.org/wiki/Microsoft_Visual_Studio
3. https://www.youtube.com/watch?v=p3gYVcggQOU
10