Commit e0f84dcb authored by ferhat tamer's avatar ferhat tamer 💬
Browse files

Initial commit

parents
namespace x.o.x;
partial class Form1
{
/// <summary>
///Gerekli tasarımcı değişkeni.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
///Kullanılan tüm kaynakları temizleyin.
/// </summary>
///<param name="disposing">yönetilen kaynaklar dispose edilmeliyse doğru; aksi halde yanlış.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
/// <summary>
/// Tasarımcı desteği için gerekli metot - bu metodun
///içeriğini kod düzenleyici ile değiştirmeyin.
/// </summary>
private void InitializeComponent()
{
button1 = new System.Windows.Forms.Button();
button2 = new System.Windows.Forms.Button();
button3 = new System.Windows.Forms.Button();
button4 = new System.Windows.Forms.Button();
button5 = new System.Windows.Forms.Button();
button6 = new System.Windows.Forms.Button();
button7 = new System.Windows.Forms.Button();
button8 = new System.Windows.Forms.Button();
button9 = new System.Windows.Forms.Button();
button10 = new System.Windows.Forms.Button();
button11 = new System.Windows.Forms.Button();
label1 = new System.Windows.Forms.Label();
button12 = new System.Windows.Forms.Button();
SuspendLayout();
//
// button1
//
button1.Location = new System.Drawing.Point(12, 12);
button1.Name = "button1";
button1.Size = new System.Drawing.Size(100, 100);
button1.Click += new System.EventHandler(this.hangiButon);
//
// button2
//
button2.Location = new System.Drawing.Point(118, 12);
button2.Name = "button2";
button2.Size = new System.Drawing.Size(100, 100);
button2.Click += new System.EventHandler(this.hangiButon);
//
// button3
//
button3.Location = new System.Drawing.Point(224, 12);
button3.Name = "button3";
button3.Size = new System.Drawing.Size(100, 100);
button3.Click += new System.EventHandler(this.hangiButon);
//
// button4
//
button4.Location = new System.Drawing.Point(12, 118);
button4.Name = "button4";
button4.Size = new System.Drawing.Size(100, 100);
button4.Click += new System.EventHandler(this.hangiButon);
//
// button5
//
button5.Location = new System.Drawing.Point(118, 118);
button5.Name = "button5";
button5.Size = new System.Drawing.Size(100, 100);
button5.Click += new System.EventHandler(this.hangiButon);
//
// button6
//
button6.Location = new System.Drawing.Point(224, 118);
button6.Name = "button6";
button6.Size = new System.Drawing.Size(100, 100);
button6.Click += new System.EventHandler(this.hangiButon);
//
// button7
//
button7.Location = new System.Drawing.Point(12, 224);
button7.Name = "button7";
button7.Size = new System.Drawing.Size(100, 100);
button7.Click += new System.EventHandler(this.hangiButon);
//
// button8
//
button8.Location = new System.Drawing.Point(118, 224);
button8.Name = "button8";
button8.Size = new System.Drawing.Size(100, 100);
button8.Click += new System.EventHandler(this.hangiButon);
//
// button9
//
button9.Location = new System.Drawing.Point(224, 224);
button9.Name = "button9";
button9.Size = new System.Drawing.Size(100, 100);
button9.Click += new System.EventHandler(this.hangiButon);
//
// button10
//
button10.Location = new System.Drawing.Point(417, 71);
button10.Name = "button10";
button10.Size = new System.Drawing.Size(50, 50);
button10.Text = "X";
button10.Click += new System.EventHandler(this.xbutonu);
//
// button11
//
button11.Location = new System.Drawing.Point(498, 71);
button11.Name = "button11";
button11.Size = new System.Drawing.Size(50, 50);
button11.Text = "O";
button11.Click += new System.EventHandler(this.button11_Click);
//
// label1
//
label1.AutoSize = true;
label1.Location = new System.Drawing.Point(401, 43);
label1.Name = "label1";
label1.Size = new System.Drawing.Size(170, 50);
label1.Font = new Font("Calibri", 10);
label1.Text = "birinci oyuncu için karakter seçin :)";
//
// button12
//
button12.Location = new System.Drawing.Point(440, 170);
button12.Name = "button12";
button12.Size = new System.Drawing.Size(100, 25);
button12.Text = "Yeniden Başlat";
button12.Click += new System.EventHandler(this.button12_Click);
//
// Form1
//
AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
ClientSize = new System.Drawing.Size(800, 450);
Controls.Add(this.button12);
Controls.Add(this.label1);
Controls.Add(this.button11);
Controls.Add(this.button10);
Controls.Add(this.button9);
Controls.Add(this.button8);
Controls.Add(this.button7);
Controls.Add(this.button6);
Controls.Add(this.button5);
Controls.Add(this.button4);
Controls.Add(this.button3);
Controls.Add(this.button2);
Controls.Add(this.button1);
Name = "Form1";
Text = "x-o-x";
Load += new System.EventHandler(this.Form1_Load);
ResumeLayout(false);
PerformLayout();
}
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.Button button3;
private System.Windows.Forms.Button button4;
private System.Windows.Forms.Button button5;
private System.Windows.Forms.Button button6;
private System.Windows.Forms.Button button7;
private System.Windows.Forms.Button button8;
private System.Windows.Forms.Button button9;
private System.Windows.Forms.Button button10;
private System.Windows.Forms.Button button11;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Button button12;
}
namespace x.o.x;
public partial class Form1 : Form
{
int berabere=0;
bool siraX;
bool siraY;
public Form1()
{
InitializeComponent();
}
public void xKazandi()
{
//yatayda ara
if(button1.Text=="X" && button2.Text=="X" && button3.Text == "X")
{
label1.Font = new Font("Calibri", 30);
label1.Text = "kazanan X";
siraX = false;
siraY=false;
berabere=1;
}
if (button4.Text == "X" && button5.Text == "X" && button6.Text == "X")
{
label1.Font = new Font("Calibri", 30);
label1.Text = "kazanan X";
siraX = false;
siraY = false;
berabere=1;
}
if (button7.Text == "X" && button8.Text == "X" && button9.Text == "X")
{
label1.Font = new Font("Calibri", 30);
label1.Text = "kazanan X";
siraX = false;
siraY = false;
berabere=1;
}
//dikey ara
if (button1.Text == "X" && button4.Text == "X" && button7.Text == "X")
{
label1.Font = new Font("Calibri", 30);
label1.Text = "kazanan X";
siraX = false;
siraY = false;
berabere=1;
}
if (button2.Text == "X" && button5.Text == "X" && button8.Text == "X")
{
label1.Font = new Font("Calibri", 30);
label1.Text = "kazanan X";
siraX = false;
siraY = false;
berabere=1;
}
if (button3.Text == "X" && button6.Text == "X" && button9.Text == "X")
{
label1.Font = new Font("Calibri", 30);
label1.Text = "kazanan X";
siraX = false;
siraY = false;
berabere=1;
}
//capraz ara
if (button3.Text == "X" && button5.Text == "X" && button7.Text == "X")
{
label1.Font = new Font("Calibri", 30);
label1.Text = "kazanan X";
siraX = false;
siraY = false;
berabere=1;
}
if (button1.Text == "X" && button5.Text == "X" && button9.Text == "X")
{
label1.Text = "kazanan X";
siraX = false;
siraY = false;
berabere=1;
}
//o için
//yatayda ara
if (button1.Text == "O" && button2.Text == "O" && button3.Text == "O")
{
label1.Font = new Font("Calibri", 30);
label1.Text = "kazanan O";
siraX = false;
siraY = false;
berabere=1;
}
if (button4.Text == "O" && button5.Text == "O" && button6.Text == "O")
{
label1.Font = new Font("Calibri", 30);
label1.Text = "kazanan O";
siraX = false;
siraY = false;
berabere=1;
}
if (button7.Text == "O" && button8.Text == "O" && button9.Text == "O")
{
label1.Font = new Font("Calibri", 30);
label1.Text = "kazanan O";
siraX = false;
siraY = false;
berabere=1;
}
//dikey ara
if (button1.Text == "O" && button4.Text == "O" && button7.Text == "O")
{
label1.Font = new Font("Calibri", 30);
label1.Text = "kazanan O";
siraX = false;
siraY = false;
berabere=1;
}
if (button2.Text == "O" && button5.Text == "O" && button8.Text == "O")
{
label1.Font = new Font("Calibri", 30);
label1.Text = "kazanan O";
siraX = false;
siraY = false;
berabere=1;
}
if (button3.Text == "O" && button6.Text == "O" && button9.Text == "O")
{
label1.Font = new Font("Calibri", 30);
label1.Text = "kazanan O";
siraX = false;
siraY = false;
berabere=1;
}
//capraz ara
if (button3.Text == "O" && button5.Text == "O" && button7.Text == "O")
{
label1.Font = new Font("Calibri", 30);
label1.Text = "kazanan O";
siraX = false;
siraY = false;
berabere=1;
}
if (button1.Text == "O" && button5.Text == "O" && button9.Text == "O")
{
label1.Font = new Font("Calibri", 30);
label1.Text = "kazanan O";
siraX = false;
siraY = false;
berabere=1;
}
if(button1.Enabled==false && button2.Enabled==false && button3.Enabled==false && button4.Enabled==false && button5.Enabled==false && button6.Enabled==false && button7.Enabled==false && button8.Enabled==false && button9.Enabled==false && berabere==0)
{
label1.Font = new Font("Calibri", 30);
label1.Text="Oyun berabere bitti.";
}
}
private void hangiButon(object sender, EventArgs e)
{
Button x = (Button)sender;
if (siraX)
{
label1.Text = "Sira O'da";
siraX = false;
siraY = true;
x.Text = "X";
x.Enabled = false;
x.BackColor = Color.DarkBlue;
xKazandi();
}
else if(siraY)
{
label1.Text = "Sira X'te";
siraX = true;
siraY = false;
x.Text = "O";
x.Enabled = false;
x.BackColor = Color.Yellow;
xKazandi();
}
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void xbutonu(object sender, EventArgs e)
{
siraX = true;
button10.Enabled = false;
button11.Enabled = false;
label1.Text = "Sira X'te";
}
private void button11_Click(object sender, EventArgs e)
{
siraY = true;
button11.Enabled = false;
button10.Enabled = false;
label1.Text = "Sira O'da";
}
private void button12_Click(object sender, EventArgs e)
{
button1.Text = "";
button2.Text = "";
button3.Text = "";
button4.Text = "";
button5.Text = "";
button6.Text = "";
button7.Text = "";
button8.Text = "";
button9.Text = "";
button1.Enabled = true;
button2.Enabled = true;
button3.Enabled = true;
button4.Enabled = true;
button5.Enabled = true;
button6.Enabled = true;
button7.Enabled = true;
button8.Enabled = true;
button9.Enabled = true;
button10.Enabled = true;
button11.Enabled = true;
siraY = false;
siraX = false;
label1.Text = "birinci oyuncu için karakter seçin";
button1.UseVisualStyleBackColor = true;
button2.UseVisualStyleBackColor = true;
button3.UseVisualStyleBackColor = true;
button4.UseVisualStyleBackColor = true;
button5.UseVisualStyleBackColor = true;
button6.UseVisualStyleBackColor = true;
button7.UseVisualStyleBackColor = true;
button8.UseVisualStyleBackColor = true;
button9.UseVisualStyleBackColor = true;
berabere=0;
label1.Font = new Font("Calibri", 10);
}
}
namespace x.o.x;
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
// To customize application configuration such as set high DPI settings or default font,
// see https://aka.ms/applicationconfiguration.
ApplicationConfiguration.Initialize();
Application.Run(new Form1());
}
}
\ No newline at end of file
{
"runtimeTarget": {
"name": ".NETCoreApp,Version=v6.0",
"signature": ""
},
"compilationOptions": {},
"targets": {
".NETCoreApp,Version=v6.0": {
"x.o.x/1.0.0": {
"runtime": {
"x.o.x.dll": {}
}
}
}
},
"libraries": {
"x.o.x/1.0.0": {
"type": "project",
"serviceable": false,
"sha512": ""
}
}
}
\ No newline at end of file
{
"runtimeOptions": {
"tfm": "net6.0",
"frameworks": [
{
"name": "Microsoft.NETCore.App",
"version": "6.0.0"
},
{
"name": "Microsoft.WindowsDesktop.App",
"version": "6.0.0"
}
]
}
}
\ No newline at end of file
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v6.0", FrameworkDisplayName = "")]
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("x.o.x")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")]
[assembly: System.Reflection.AssemblyProductAttribute("x.o.x")]
[assembly: System.Reflection.AssemblyTitleAttribute("x.o.x")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
[assembly: System.Runtime.Versioning.TargetPlatformAttribute("Windows7.0")]
[assembly: System.Runtime.Versioning.SupportedOSPlatformAttribute("Windows7.0")]
// MSBuild WriteCodeFragment sınıfı tarafından oluşturuldu.
aa515587026f3b5ffd75390f7fa9f337c5ffba86
is_global = true
build_property.ApplicationManifest =
build_property.StartupObject =
build_property.ApplicationDefaultFont =
build_property.ApplicationHighDpiMode =
build_property.ApplicationUseCompatibleTextRendering =
build_property.ApplicationVisualStyles =
build_property.TargetFramework = net6.0-windows
build_property.TargetPlatformMinVersion = 7.0
build_property.UsingMicrosoftNETSdkWeb =
build_property.ProjectTypeGuids =
build_property.InvariantGlobalization =
build_property.PlatformNeutralAssembly =
build_property._SupportedPlatformList = Linux,macOS,Windows
build_property.RootNamespace = x.o.x
build_property.ProjectDir = C:\Users\ferhat\Desktop\wpf\x.o.x\
// <auto-generated/>
global using global::System;
global using global::System.Collections.Generic;
global using global::System.Drawing;
global using global::System.IO;
global using global::System.Linq;
global using global::System.Net.Http;
global using global::System.Threading;
global using global::System.Threading.Tasks;
global using global::System.Windows.Forms;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment