伸进女同桌乳沟里摸爽了,小雪解开乳罩给老杨摸,少妇被按摩师摸高潮了,亲嘴扒胸摸屁股激烈视频,强摸秘书人妻大乳BD,摸BBB揉BBB揉BBB视频

新疆軟件開發(fā)

本站首頁 軟件開發(fā) 成功案例 公司新聞 公司簡介 客服中心 軟件技術 網(wǎng)站建設
  您現(xiàn)在的位置: 新疆二域軟件開發(fā)公司 >> .Net技術 >> 文章正文

C# Mines(布雷) 代碼

一個C# Mines(布雷)的 代碼,新手研究一下吧,新疆軟件開發(fā)網(wǎng) www.zgna.net

using System.Collections;
using System.IO;
using System;
namespace com.Mines
{
class SearchingMines
{
public ArrayList list = new ArrayList();
public int[,] mines = new int[10, 10];
static void Main(string[] args)
{
SearchingMines sm = new SearchingMines();
sm.initMines();
sm.HidenMines();
sm.FillInOtherNumber();
sm.display();
// sm.SaveTxt();
}
public void initMines()
{
for (int i = 0; i < this.mines.GetLength(0); i++)
{
for (int j = 0; j < this.mines.GetLength(1); j++)
{
this.mines[i, j] = 0;
list.Add(this.mines[i, j]);
}
}
}

public void HidenMines()
{

Random r = new Random();
for (int i = 0; i < 9; i++)
{
int count = this.list.Count;
int number = r.Next(count);
int row = number / 10;
int column = number % 10;
this.mines[row, column] = 9;
this.list.RemoveAt(this.mines[row, column]);
}


}

public void FillInOtherNumber()
{
try
{

for (int i = 0; i < this.mines.GetLength(0); i++)
{
for (int j = 0; j < this.mines.GetLength(1); j++)
{

int left = j - 1;
int right = j + 1;
int top = i - 1;
int bottom = i + 1;
if (this.mines[i, j] != 9)
{
if(top>=0 && left>=0)//左邊和上邊
{
if (this.mines[top, left] == 9)//判斷左上方是否為9
{
mines[i,j] += 1;
}
}
if(top>=0 && right<10)//右邊和上邊
{
if (this.mines[top, right] == 9)//判斷該點的右上方是否
{
mines[i,j] += 1;
}
}
if(top>=0)//最上邊
{
if (this.mines[top, j] == 9)//上邊的那個是否為9
{
mines[i,j] += 1;
}
}
if(left>=0)//最左邊
{
if (this.mines[i, left] == 9)//看左邊那個是否為9
{
mines[i,j] += 1;
}
}
if(right<10)//最右邊
{
if (this.mines[i, right] == 9)//看右邊是否為9
{
mines[i,j] += 1;
}
}
if(bottom<10 && left >=0)//底部和左邊
{
if (this.mines[bottom, left] == 9)//左下方是否為9
{
mines[i,j] += 1;
}
}

if(bottom<10 && right<10)//右下方
{
if (this.mines[bottom, right] == 9)右下方
{
mines[i,j] += 1;
}
}
if(bottom<10)//底部
{
if (this.mines[bottom, j] == 9)//底部是否為9
{
mines[i,j] += 1;
}
}

// if (left < 0)//左邊
// {
// if (this.mines[i, right] == 9)//右側(cè)是否為9
// { count += 1; }
// if (bottom < 10 && bottom > 0)//如果底邊的范圍是除過頭節(jié)點和尾節(jié)點
// {
// if (this.mines[bottom, j] == 9)//底部是否為9
// { count += 1; }
// if (this.mines[bottom, right] == 9)//右下是否為9
// { count += 1; }
// }
// if (top > 0 && top < 10)//上邊除過頭結(jié)點和尾節(jié)點
// {
// if (this.mines[top, j] == 9)//頭上那個點是否為9
// { count += 1; }
// if (this.mines[top, right] == 9)//右上是否為9
// { count += 1; }
// }
// }
// if (j == this.mines.GetLength(0))
// {
// if (i == 0)

// {
// if (this.mines[i, j - 1] == 9)
// { count += 1; }
// if (this.mines[i - 1, j - 1] == 9)
// { count += 1; }
// if (this.mines[i - 1, j] == 9)
// { count += 1; }
//
// }
// if(i>0&&i<this.mines.GetLength(1))
// {
// if(this.mines[i+1,j-1]==9)
// {count+=1;}
// if (this.mines[i + 1, j] == 9)
// { count += 1; }
// if (this.mines[i, j - 1] == 9)
// { count += 1; }
// if (this.mines[i - 1, j] == 9)
// { count += 1; }
// if (this.mines[i - 1, j - 1] == 9)
// { count += 1; }
// }
// if (i == this.mines.GetLength(1))
// {
// if (this.mines[i - 1, j - 1]==9)
// { count += 1; }
// if (this.mines[i - 1, j] == 9)
// { count += 1; }
// if (this.mines[i, j - 1] == 9)
// { count += 1; }
// }
// }


// this.mines[i, j] = count;
}
}
}
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
}

public void display()
{
for (int i = 0; i < this.mines.GetLength(0); i++)
{
for (int j = 0; j < this.mines.GetLength(1); j++)
{
Console.Write(this.mines[i, j] + " ");
}
Console.Write("n");
}

}

public void SaveTxt()
{
StreamWriter sw = new StreamWriter(@"c:abc.txt");
for (int i = 0; i < this.mines.GetLength(0); i++)
{
for (int j = 0; j < this.mines.GetLength(1); j++)
{
sw.Write(this.mines[i, j] + " ");
}
sw.WriteLine();
}
sw.Flush();
sw.Close();

}


}

}


in

作者:未知 | 文章來源:未知 | 更新時間:2007-11-17 17:16:57

  • 上一篇文章:

  • 下一篇文章:

  • 相關文章:
    C#實現(xiàn)短信發(fā)送程序的例子
    .net學習:c#事件的深入分析
    基礎學習:java中使用存儲過程
    C#如何設置或者獲取目錄的權限?
    解析c#語言和java語言最相似的地方
    C#中如何才能調(diào)用QTP自動化對象
    C#如何轉(zhuǎn)換AVI文件為BMP位圖文件
    c#如何連接各類數(shù)據(jù)庫
    C#abstact interface 學習
    c#中的interface abstract與virtual學習
    軟件技術
    · 開發(fā)語言
    · Java技術
    · .Net技術
    · 數(shù)據(jù)庫開發(fā)
    最新文章  
    ·.net技術 asp.net MVC3 Vi
    ·.net將視頻文件格式轉(zhuǎn)換成
    ·NET Framework 2.0 Servic
    ·如何動態(tài)修改winform的app
    ·asp,net軟件結(jié)構設計和相關
    ·學習怎樣使用ASP.NET中的虛
    ·,net基礎類的學習:system
    ·.net學習:c#事件的深入分
    ·Facade Pattern學習總結(jié)
    ·C#如何設置或者獲取目錄的
    ·如何使用XSL來定義ASP.NET
    ·理解WCF Data Contract契約
    ·如何能在.net2.0開發(fā)的控件
    ·模式怎樣使用,講解模式的
    ·如何解決Menu菜單被frame遮
    關于我們 | 軟件開發(fā) | 下載試用 | 客服中心 | 聯(lián)系我們 | 友情鏈接 | 網(wǎng)站地圖 | 新疆電子地圖 | RSS訂閱
    版權所有 © 2016 新疆二域軟件開發(fā)網(wǎng) www.zgna.net All Rights Reserved 新ICP備14003571號
    新疆軟件開發(fā)總機:0991-4842803、4811639.
    客服QQ:596589785 ;地址:新疆烏魯木齊北京中路華聯(lián)大廈A-5C 郵編:830000
     
    新田县| 融水| 灵璧县| 思南县| 松溪县| 且末县| 鸡西市| 台东市| 德保县| 米林县| 囊谦县| 安平县| 沁阳市| 洛宁县| 吉木萨尔县| 松阳县| 循化| 罗源县| 会宁县| 肇东市| 诸暨市| 潮安县| 阿荣旗| 万山特区| 运城市| 松江区| 曲水县| 广河县| 黑龙江省| 龙江县| 惠安县| 竹溪县| 漳平市| 东辽县| 建湖县| 和平县| 竹溪县| 桃园市| 嵊泗县| 平和县| 怀来县|