Here is what I have so far
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 ArraySelectionSort
{
public partial class frmArraySelectionSort : Form
{
public frmArraySelectionSort()
{
InitializeComponent();
}
private void btnCreateArray_Click(object sender, EventArgs e)
{
// generate the array
int SizeOfTheArray;
int 1darray;
Random randomNumberGenerator = new Random();
int aRandomNumber;
string aPieceOfText = null;
SizeOfTheArray = Convert.ToInt16(this.numudValues.Value);
// declare the array
int[,] a2DArray = new int[SizeOfTheArray];
for (int widthCounter = 0; widthCounter < SizeOfTheArray; widthCounter++)
{
{
aRandomNumber = randomNumberGenerator.Next(0, 9+1);
a1DArray[widthCounter] = aRandomNumber;
aPieceOfText = aPieceOfText + " " + aRandomNumber;
}
aPieceOfText = aPieceOfText + "\r" + "\n";
}
this.lstbArray.Text = aPieceOfText;
}
}
}
I got most of this code from an other program that makes 2d arrays (the user puts in the length and width of a rectangle and the program makes a rectangle with the length and width out of random numbers)
My program is supposed to make a line of random numbers. that line is as long as the user wants.
Can you tell me what im doing wrong, and what parts I still need to change?