My code

Talk about your favorite PC games, Steam and building awesome custom rigs!

Moderator: Moderators

Post Reply
User avatar
Rohan The Wind Waker
Posts: 75
Joined: Sat Jul 02, 2011 12:49 am
Location: Rochester, New York
Contact:

My code

Post by Rohan The Wind Waker » Mon Aug 22, 2011 2:25 pm

Today im making a game. Im writing it in c#. Here is the code.
Spoiler:
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System;

namespace WindowsFormsApplication2
{
public partial class Form1 : Form
{
public Form1()
{

InitializeComponent();
{
pic1.Visible = false;
pic2.Visible = false;
pic3.Visible = false;
pic4.Visible = false;
pic5.Visible = false;
pic6.Visible = false;
pic7.Visible = false;
pic8.Visible = false;
pic9.Visible = false;
pic10.Visible = false;
pic11.Visible = false;
pic12.Visible = false;
pic13.Visible = false;
pic14.Visible = false;
pic15.Visible = false;

Random random = new Random();
int randomNumber = random.Next(1, 15);
rad.Value = randomNumber;
{
if (randomNumber < 2)
if (randomNumber > 0)
pic1.Visible = true;
}
{
if (randomNumber < 3)
if (randomNumber > 1)
pic2.Visible = true;
}
{
if (randomNumber < 4)
if (randomNumber > 2)
pic3.Visible = true;
}
{
if (randomNumber < 5)
if (randomNumber > 3)
pic4.Visible = true;
}
{
if (randomNumber < 6)
if (randomNumber > 4)
pic5.Visible = true;
}
{
if (randomNumber < 7)
if (randomNumber > 5)
pic6.Visible = true;
}
{
if (randomNumber < 8)
if (randomNumber > 6)
pic7.Visible = true;
}
{
if (randomNumber < 9)
if (randomNumber > 7)
pic8.Visible = true;
}
{
if (randomNumber < 10)
if (randomNumber > 8)
pic9.Visible = true;
}
{
if (randomNumber < 11)
if (randomNumber > 9)
pic10.Visible = true;
}
{
if (randomNumber < 12)
if (randomNumber > 10)
pic11.Visible = true;
}
{
if (randomNumber < 13)
if (randomNumber > 11)
pic12.Visible = true;
}
{
if (randomNumber < 14)
if (randomNumber > 12)
pic13.Visible = true;
}
{
if (randomNumber < 15)
if (randomNumber > 13)
pic14.Visible = true;
}
{
if (randomNumber < 16)
if (randomNumber > 14)
pic15.Visible = true;

}

}
}


private void pic5_Click(object sender, EventArgs e)
{
if (pic5.Visible == true)
Rad2.Value = Rad2.Value + 10;
pic5.Visible = false;
}
private void pic10_Click(object sender, EventArgs e)
{
if (pic10.Visible == true)
Rad2.Value = Rad2.Value + 10;
pic10.Visible = false;
}

private void pic4_Click(object sender, EventArgs e)
{
if (pic4.Visible == true)
Rad2.Value = Rad2.Value + 10;
pic4.Visible = false;
}

private void pic9_Click(object sender, EventArgs e)
{
if (pic9.Visible == true)
Rad2.Value = Rad2.Value + 10;
pic9.Visible = false;
}

private void pic11_Click(object sender, EventArgs e)
{
if (pic11.Visible == true)
Rad2.Value = Rad2.Value + 10;
pic11.Visible = false;
}

private void pic1_Click(object sender, EventArgs e)
{
if (pic1.Visible == true)
Rad2.Value = Rad2.Value + 10;
pic1.Visible = false;
}

private void pic13_Click(object sender, EventArgs e)
{
if (pic13.Visible == true)
Rad2.Value = Rad2.Value + 10;
pic13.Visible = false;
}

private void pic14_Click(object sender, EventArgs e)
{
if (pic14.Visible == true)
Rad2.Value = Rad2.Value + 10;
pic14.Visible = false;
}

private void pic6_Click(object sender, EventArgs e)
{
if (pic6.Visible == true)
Rad2.Value = Rad2.Value + 10;
pic6.Visible = false;
}

private void pic2_Click(object sender, EventArgs e)
{
if (pic2.Visible == true)
Rad2.Value = Rad2.Value + 10;
pic2.Visible = false;
}

private void pic7_Click(object sender, EventArgs e)
{
if (pic7.Visible == true)
Rad2.Value = Rad2.Value + 10;
pic7.Visible = false;
}

private void pic8_Click(object sender, EventArgs e)
{
if (pic8.Visible == true)
Rad2.Value = Rad2.Value + 10;
pic8.Visible = false;
}

private void pic3_Click(object sender, EventArgs e)
{
if (pic3.Visible == true)
Rad2.Value = Rad2.Value + 10;
pic3.Visible = false;
}

private void pic12_Click(object sender, EventArgs e)
{
if (pic12.Visible == true)
Rad2.Value = Rad2.Value + 10;
pic12.Visible = false;
}

private void pic15_Click(object sender, EventArgs e)
{
if (pic15.Visible == true)
Rad2.Value = Rad2.Value + 10;
pic15.Visible = false;
}

private void off_Tick(object sender, EventArgs e)
{

}

}
}
I put it in a spoiler because its soo long.
Any why i want it so it repeats. Can anyone help me?
Rohan The \/\/ind \/\/aker
I didn't lose my mind, I sold it on ebay

User avatar
Rohan The Wind Waker
Posts: 75
Joined: Sat Jul 02, 2011 12:49 am
Location: Rochester, New York
Contact:

Re: My code

Post by Rohan The Wind Waker » Wed Aug 24, 2011 5:52 pm

Bump
Rohan The \/\/ind \/\/aker
I didn't lose my mind, I sold it on ebay

User avatar
bassmasta
Posts: 684
Joined: Sun Sep 06, 2009 8:56 pm
Steam ID: randomguy737
Contact:

Re: My code

Post by bassmasta » Wed Aug 24, 2011 11:38 pm

http://lmgtfy.com/?q=looping+in+c%23" onclick="window.open(this.href);return false;
zeturi wrote:If you're getting 404'd when trying to use the links in stickies, try this tutorial to find that juicy info.

Post Reply