15,895,667 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by TAOG ASOGA (Top 19 by date)
TAOG ASOGA
16-Jun-14 0:08am
View
Sorry sir, but this is for my culminating in my comp science class. My teacher wants me use the common string functions (Replace, Insert, Substring, IndexOf, Remove, Contains) as much as possible. I haven't learned LINQ yet.
TAOG ASOGA
15-Jun-14 21:19pm
View
**good news! Very close! I discovered this function called "LastIndexOf" it finds the instance of "a" that appears last in the word alabama. But how can I find the other instances of "a" in between the first and the last instance?
TAOG ASOGA
15-Jun-14 21:13pm
View
well snap, um the string.replace only replaces all the underscores in the word with "a". :-(
TAOG ASOGA
15-Jun-14 21:11pm
View
ok, I'll try string replace and see how it goes. :-)
TAOG ASOGA
15-Jun-14 20:46pm
View
you mean for loops, something that scans through the word and if it finds the position(s) that has the guessed letter(s)? I tried making a variable that does that but then I don't know keep the detected position.
TAOG ASOGA
15-Jun-14 20:36pm
View
well um sir, while I was working on the code, I kind of worked on it like I was rushing a math problem on a test. My bad habits of writing jumbles of things trying to get it right. sorry bout that.
I updated the code again though, tested it out it's **almost** working fine now. The only problem is that it inserts one position of a correct letter **even when there's more than one instance of that letter in a word (e.g the mystery word is "alabama," There are 4 "a's" in the word but when I press "a" it only shows one of the "a's".
TAOG ASOGA
15-Jun-14 20:20pm
View
I used the ToString function to update the word to show the correct letters (if the user guesses the correct letter).
TAOG ASOGA
3-Jun-14 19:36pm
View
SIR I FIGURE IT OUT! WOOOOO!! I'm still stitching all the code together. But I found out how to replace the old variable.
TAOG ASOGA
3-Jun-14 15:55pm
View
yeah, but only if the color of one of the tiles on the row is still black.
My "if" condition for that was this:
if (yf1 > y)
{
if (bc1 == bsh_black || bc2 == bsh_black || bc3 == bsh_black || bc4 == bsh_black)
{
MessageBox.Show("Game Over");
}
}
TAOG ASOGA
3-Jun-14 15:48pm
View
first off to make things clearer, at the top of the program I declared to variables: int x, y;
Then I gave them this value:
x = ClientRectangle.Width;
y = ClientRectangle.Height;
Then, that's where I declared x1, x2, etc.
The x1, x2, x3, x4 variables represented a different position. And with the variable "x" being the horizontal length of the form
here's the values I gave them:
x1 = 0;
x2 = x / 4;
x3 = (x / 4) * 2; //or just "x2 * 2"
x4 = (x / 4) * 3;
Basically the same thing for y.
The pat1...pat4 represent the patterns.
Those variables I declared them to represent different arrangements of the tiles in a row.
For example like what I included in the question
if (pat_assign == pat2)
{
bchanger1 = bsh_white;
bchanger2 = bsh_black;
bchanger3 = bsh_white;
bchanger4 = bsh_white;
}
Depending on the pattern (or pat variable chosen), if will assign a certain color to each tile. I did this via "if" conditions.
And so to randomize the selection of these patterns, I declared a an array and a random variable and a variable that will assign the randomly chosen pattern variable like this:
int[] pat_select = new int[4]{pat1, pat2, pat3, pat4};
Random pat_changer = new Random();
int pat_assign = pat_select[pat_changer.Next(0, pat_select.Length)];
TAOG ASOGA
3-Jun-14 15:09pm
View
yes sir, sorry again. The x1, x2, x3, and x4 represent the columns of the tiles. The "yf1" variable is the variable that will bring the row of tiles downward via the tile_timer.
TAOG ASOGA
3-Jun-14 14:46pm
View
yes sir.
TAOG ASOGA
3-Jun-14 14:41pm
View
um it was a variable I intended earlier when I started the code to use to define the state of the game. I later realized there was an easier way to code the game's state using "if" conditions and I didn't need the variable afterwards. Sorry sir, I'll be removing that variable when I "clean up" the code.
TAOG ASOGA
3-Jun-14 14:32pm
View
The tile_timer_Tick is the Event for the tile_timer sir. And yes sir I'm drawing on the form.
TAOG ASOGA
3-Jun-14 14:07pm
View
Actually, they're the same, I just changed the name from Block_Timer to tile_timer. Sorry sir.
TAOG ASOGA
3-Jun-14 14:01pm
View
yes sir
TAOG ASOGA
28-May-14 13:02pm
View
@CarefulCoder thanks sir! This worked! I just had to include the invalidate and the main function of the game was ready to go! Thanks!
TAOG ASOGA
28-May-14 7:12am
View
Yes sir.
TAOG ASOGA
27-May-14 23:12pm
View
Sorry sir, I forgot to put that part of code in earlier. It's here now (in the question)
Show More