Thursday, November 30, 2017

The last C# programming challenge I completed


Greetings everyone! Once again, just by looking at the title, you know what I will be talking about. Now I know that some of you out there aren't programmers, so I will try not to go all computer nerd, and be like, "and this line of code does this, while this makes this do that-" Also, just to be clear, when I say last challenge, I just mean the last thing the book wanted me to do. I'm still programming my own games.

So as you can see in the video, I made a game of Chess. And I have to say, the coding was complicated. Now every time the book gave me a challenge, I needed to open an activity document on my File Explorer. Usually, I'm only given one document. But for this challenge, I was given five documents. The first one wasn't so bad, until the end. I couldn't get the coding right, so I asked my Dad. Guess what we found out. The code that I was trying to put in, wasn't supposed to be put in just yet! As a matter of fact, later in time, I learned that the same code I was trying to put in, was in the wrong place. The second document was the easiest one. All I had to do, was cut and paste a file on my File Explorer. But after that is where things got hard.

One of the hardest parts, was where I had to fill in the Handle click method. The reason it was hard was because I had to tell the computer what to do in case of check, still in check, what to do if a piece is captured, and select/deselect a chess piece. The deadline to complete this challenge was Thanksgiving. I only had a few weeks to meet the deadline. So I would try to get as much coding in as possible every time I worked on it. Another hard part was the pawn. All I had to do at one point was tell it how it can move at the start, after the first move, and have it move diagonal when it captures an enemy. There are about 43 lines of code for just the pawns. Rooks and bishops have only 4, kings and queens have 9, and the knights have 17. (Yes, I counted for this post....)

Well, in the end of it all, I didn't want my Chess game to be like the others. So I decide that if you move your king, but it's still in check, the message box will say, "Nice move. However, your king is still in DANGER!" The other thing I did, was put in a beep whenever your king is still in danger, or is in check. All in all, this was a good programming course. Which I also met the deadline! But the next time I make a visual game, I'm going to copy and paste my Chess board program. :-)

Monday, November 20, 2017

RoboGames of 2017

Hello again everyone! As you can tell by the title, I'll be talking about RoboGames again. But this time, I'll be talking about one of the challenges I did.

So after last year, I knew it was time to do a challenge that I have yet to do. I decided to do Open Lego, where you can build anything you want, and the judges will pick the best robot. At first I thought of re-creating my Lego Wall.E that I built few years ago that can move on it's own. But then the thought of re-creating the original Star Tours ride at Disneyland came to mind, and I thought, "Ya. That's one idea. But lets keep thinking." But the more I thought about making Star Tours, the more I liked it. I started running though how I was going to build it, then decided to go with that plan! But it didn't turn out easy. I ended up building lots of prototypes that didn't hold up the ride. Until I got it figured out one day. I improved the design, built a smaller Lego Star Speeder that would sit on top, then got on with programming! (Timing the part of the ride for where you are in a comet took forever.......) The rules were simple. You build a robot out of nothing but Legos, you can't have anything that doesn't have the Lego logo on it be connected to the robot, and after you show case your robot, the judges will take a look at your robot, and figure out which place it's in. What I had for my display, was the robot, a poster board, and my bigger Star Speeder, which is the first prototype that I made. Behind my robot, was a computer showing the ride moving in time with my robot. This is allowed, because the computer was not hooked up in anyway to my robot. Under the table was a charger with batteries in it. This was because when the power got low on my robot, I could just switch the batteries, and I didn't have to tell people, "Sorry. Low on battery. You'll have to wait."

I actually really liked this challenge. Because I got to do nothing but play with my robot! Some times, there would be a mass of people, and other times, it was quiet. Open Lego was right by another challenge just like this one, except with advanced robots. So at one point, I noticed that a large group of people were looking at the advanced robots. I figured that if I had my robot going when they moved along, I would be the one of the first stops due to where my robot was set up. Which it turned out that I was right! There were also quite a bit of people that lit up when they saw it. One teen was so interested in my robot, he would came back to see it whenever he got the chance. There was one man who wanted to know more about Lego robots. So I showed him the program, what it has, where he can get a Lego robot, and even told him what club I'm in. However, just like in the book of "Mouse Tales," there were some weird comments. I guess now that I look back, they were pretty funny. I remember one question, where after someone watched my robot for a little bit, asked if the bigger version of the Star Speeder was the new ride. Even though the bigger version looks the same, and there is a poster of the new ride, which does look completely different, and even has a card that says, "in the new ride." Actually, I think that was the most asked question. Some people said, "So this one here must be the new ride!" There was one guy who saw it, walked away, came back with little kids, and said, "Look! It's a walking robot! No.... Wait.... What is this?" I think the most "head-scratching" comment was when one guy said, "That's Star Tours! Ya. That's in Disney Universal." How he combined the two, I don't know. So I just said after his short speech about the ride, "It's not in Universal. But it is in all of the Disney parks."

When the time came for the robots to be judged, I started thinking that I would need to explain why I had tires on the side of my robot. But when they came over, few questions in, and one of them says, "Are those tires there to keep it stable?" I was so happy, because he got it right! I didn't have to explain it! They asked questions like, what was the hardest part? How long did it take you to build it? And how does it work? Now I don't know about anyone else, but the judges were the best. I didn't stay in the building too long after the judges. Reno Robot Club built a battle bot, and I had to be there because I'm part of the team. Long story short about battle bots, we made the other robot smoke during the second round, and made it though the full three minutes, which we did lose. (but we made it to the second round!) Then I went back to Open Lego, to find out that I ended up in third place! All in all, this was a really good day. And guess what? You've just read a really long story! Give yourself a hand!