Moving numbers in richTextBox in C# -


I need to solve the behavior of four numbers, which is what the game Tetris means to move down or rotate it That I want to do at C ++ on RichTextBox, but my code is still not working well as I want to illustrate below. How can I make this number in the right direction?

0 0 0 0 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

0 0 0 0 0 0 0 0 0 0 0

0 0 0

0 0 0 0 0 0 0

After going down four numbers "1"

0 0 0 0 0 0 0 0 0 0 0 0 0 < P> 0 0 0 1 1 1 1 0 0 0 0 0

0 0 0 0 0 0 0 0 0 0 0 0 0

0 0 0 0 0 0 0 0 0 0 0 0

0 0 0 0 0 0 0 0 0 0 0 0 0 0

Or four times the clock of "1" After rotation

0 0 0 0 0 0 0 0 0 0 0

0 0 0 1 0 0 0 0 0 0 0 0

0 0 0 1 0 0 0 0 0 0 0 0

0 0 0 1 0 0 0 0 0 0 0 0

0 0 0 1 0 0 0 0 0 0 0 0 0

This is my code.

  string [] pole8x8 = new string [400]; String [] poll 4x4 = new string [4 * 2]; & Lt; String & gt; Numbers = New list & lt; String & gt; (); Int lane = 52; Public Form 1 () {Initialization (); For (int i = 0; i    

Well, I think your implementation requires some refinement, But here's some code that will start from some sizes and will take them down well. They ... 'coup' below, unlike Tetris, where the figures retain their rigidity. But I think it answers your question. the rest is up to you.

Edit: I forgot to mention my rich textbox courier is set to use the new font (and the non-true font should work.)

  Public Partial Sector Form 1: Form {Private Int _tickCounter = 0; Private int _ticklimit = 500; // set 10 or something for personal string [,] _dataArray; Public Form 1 () {Initialization (); } Private Zero Timer 1_Tick (Object Sender, EventArgs e) {_tickCounter ++; If (_tickCounter & gt; = _tickLimit) {// Add one piece AddNewPieceToWell (true); _tickCounter = 0; } else {// move the current piece downwards (int rowCounter = _dataArray.GetUpperBound (0); rowCounter> gt; = 1; rowCounter--) {for (int colCounter = 0; colCounter & lt; = _dataArray .getUpperBound (1); colCounter ++) {if (_dataArray [rowCounter, Colcounter] == "" & amp; _dataArray [quadrant-1, colCounter] == "0") {_dataArray [rowCounter, colcounter] = "0"; _dataArray [rowCounter - 1, colcounter] = ""; }}}} Good picture created (); } Private Zero form1_load (object sender, event ergues e) {initialize vell (); Timer1.Start (); } Private Zero initializeWell () {_dataArray = New string [,] {{"", "", "0", "0", "0", "0", "", ""}, {"", " "", "", "", "", "", "", "", "", "", "", "", "", ""}, {" "", "", "", "", "", "", "" 0 "," 0 "," 0 "," 0 "," "," "," "," "", "" , "", "", "", "", "", ""}, {"", "", "", "", "", "", "", ""}}} Good picture made (); } Private Zero DrawWell () {rtbWell.Text = string.Empty; (Int colCounter = 0; colCounter & lt; = _dataArray.GetUpperBound (1); colCounter ++) for {int rowCounter = 0; rowCounter & lt; = _dataArray.GetUpperBound (0); rowCounter ++} { RtbWell.Text + = _dataArray [rowCounter, clockwise]; } RtbWell.Text + = Environmental.NewLine; }} Private Zero AddNewPieceToWell (bool RandomPiece = true) {// ToDo}}    

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -