C#超新手請求協助
版上的前輩們好
因為實習上的需求 要寫個簡單的拉霸機程式
可我自己一點程式語言基礎也沒有 想說就去買書摸看看
大概是天資不夠聰穎 弄了好久卻一點成果也沒有
於是只好上來請求好心人的協助了 請幫幫忙~~
這個拉霸機沒有要很複雜
只要每次按鈕後 每個方格能跑出不同圖案就好 (不用連線也不用計分)
以下是我自己的嘗試
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
int i = 0, score = 0;
private void button1_Click(object sender, EventArgs e)
{
}
private void pictureBox1_Click(object sender, EventArgs e)
{
}
private void pictureBox2_Click(object sender, EventArgs e)
{
}
private void pictureBox3_Click(object sender, EventArgs e)
{
}
private void pictureBox4_Click(object sender, EventArgs e)
{
}
private void pictureBox5_Click(object sender, EventArgs e)
{
}
private void pictureBox6_Click(object sender, EventArgs e)
{
}
private void pictureBox7_Click(object sender, EventArgs e)
{
}
private void pictureBox8_Click(object sender, EventArgs e)
{
}
private void pictureBox9_Click(object sender, EventArgs e)
{
}
private void timer1_Tick(object sender, EventArgs e)
{
int v1, v2, v3, v4, v5, v6, v7, v8, v9;
Random rndObj = new Random();
int rndNum = rndObj.Next();
i++;
v1 = rndObj.Next(2);
v2 = rndObj.Next(2);
v3 = rndObj.Next(2);
v4 = rndObj.Next(10);
v5 = rndObj.Next(10);
v6 = rndObj.Next(10);
v7 = rndObj.Next(10);
v8 = rndObj.Next(10);
v9 = rndObj.Next(10);
pictureBox1.Image = imageList1.Images[v1];
pictureBox2.Image = imageList1.Images[v2];
pictureBox3.Image = imageList1.Images[v3];
pictureBox4.Image = imageList1.Images[v4];
pictureBox5.Image = imageList1.Images[v5];
pictureBox6.Image = imageList1.Images[v6];
pictureBox7.Image = imageList1.Images[v7];
pictureBox8.Image = imageList1.Images[v8];
pictureBox9.Image = imageList1.Images[v9];
if (i == 25)
{
timer1.Enabled = false;
button1.Enabled = true;
button1.Text = "拉霸!";
pictureBox1.Image = imageList1.Images[v1];
pictureBox2.Image = imageList1.Images[v2];
pictureBox3.Image = imageList1.Images[v3];
pictureBox4.Image = imageList1.Images[v4];
pictureBox5.Image = imageList1.Images[v5];
pictureBox6.Image = imageList1.Images[v6];
pictureBox7.Image = imageList1.Images[v7];
pictureBox8.Image = imageList1.Images[v8];
pictureBox9.Image = imageList1.Images[v9];
i = 0;
}
}
}
}
因為我是超新手 (連問題在哪也不曉得)
如果你願意花點時間教我寫出這個程式 我會很感謝的
我人在板橋 可以帶著筆電去找你 (北縣市可)
願以下午茶或晚餐作為回報
站內信或水球都歡迎
謝謝
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 61.229.192.82
→
11/30 02:04, , 1F
11/30 02:04, 1F
→
11/30 02:11, , 2F
11/30 02:11, 2F
→
11/30 02:12, , 3F
11/30 02:12, 3F
→
11/30 12:38, , 4F
11/30 12:38, 4F
→
11/30 12:40, , 5F
11/30 12:40, 5F
→
11/30 12:41, , 6F
11/30 12:41, 6F
→
12/01 20:03, , 7F
12/01 20:03, 7F
→
12/01 20:04, , 8F
12/01 20:04, 8F
推
12/05 17:35, , 9F
12/05 17:35, 9F