Soooo it has been quite awhile since i last updated this. I hit a bit of a rough road and well i had actually was supposed to be practicing java instead of C# like i had originally been doing.
I'm not sure why but i was definitely having a lot more fun with C# than i was with Java. Java despite doing pretty well in it in the beginning...it just seems so...not fully functional i guess? It's the curly braces that get me! i love visual studios way of doing it where as soon as you type { it auto-completes it with } where as in eclipse when you type the { it stays...nothing happens until you press enter! C'mon give an option with that!!!
Anyways! I did two programs for java!!! The first one is the classic 99 bottles song and there was an intentionally left out a part to the program to make it fully functional. So a while statement around the actual beerNum = beerNum - 1; before it would do 99 minus 1 and stop at 98.
So i added while (beerNum > 0) which concluded the program and i felt great for actually solving that. Thanks Head First ;).
https://github.com/s0nlxaftrsh0ck/Bottles
Secondly is a random buzzword generator that uses an array of words that i've added and uses a random number generator by grabbing the length of the array. Since it grabs the length of the array it has the numbers and it can dump it into random number generator pool. Thanks to .length
https://github.com/s0nlxaftrsh0ck/Phrases
So far...i'm getting back into the groove of programming ^_^
-Ron
Showing posts with label Git. Show all posts
Showing posts with label Git. Show all posts
Tuesday, March 25, 2014
Wednesday, March 12, 2014
Oops..kinda forgot i was supposed to be practicing in java...
Wellll i kinda forgot i was going to be refining my skills and helping my friend code for a potential game he may be doing? I'm going to be freelancing it of course So at the moment this is going to be my final C# project for now. Honestly i'm glad i stopped early enough to not be in toooo deep with C#. So after this we're going back into java!!!
GlazerCalcUltra
https://github.com/s0nlxaftrsh0ck/GlazerCalcUltra
This is a heavily modified version of the original GlazerCalc in that it adds const which is a static value that is can never be changed. It's honestly a very handy tool to use for when you add final type values throughout your program. If an enemy is only 100pts and you have to code that 100pts 300 times...you don't wanna go and change 300 lines of code.
No, so all you have to do is make the const and change the const value and everything else in your coding that correlates to that const value is changed.
This also includes a do -- while loop which does an action while it is still valid. One thing i have noticed in programming is to code in reverse. It's that i have to code for what i DON'T want not what i want it to do.
So in this case instead of searching for values within my range i look for values OUTSIDE of my range which is easier to catch and a little bit neater from the looks of it. But that is something i really should take into consideration however. Sometimes you gotta see from the reverse...or make it an impenetrable fortress perhaps? But yeah. So for now...that is my last C# project.
At least with C# this taught me some fundamentals that i was a little hazy on before. Like operands and expressions, variables. And the likes. But yeah. Good times!
-Ron
GlazerCalcUltra
https://github.com/s0nlxaftrsh0ck/GlazerCalcUltra
This is a heavily modified version of the original GlazerCalc in that it adds const which is a static value that is can never be changed. It's honestly a very handy tool to use for when you add final type values throughout your program. If an enemy is only 100pts and you have to code that 100pts 300 times...you don't wanna go and change 300 lines of code.
No, so all you have to do is make the const and change the const value and everything else in your coding that correlates to that const value is changed.
This also includes a do -- while loop which does an action while it is still valid. One thing i have noticed in programming is to code in reverse. It's that i have to code for what i DON'T want not what i want it to do.
So in this case instead of searching for values within my range i look for values OUTSIDE of my range which is easier to catch and a little bit neater from the looks of it. But that is something i really should take into consideration however. Sometimes you gotta see from the reverse...or make it an impenetrable fortress perhaps? But yeah. So for now...that is my last C# project.
At least with C# this taught me some fundamentals that i was a little hazy on before. Like operands and expressions, variables. And the likes. But yeah. Good times!
-Ron
Tuesday, March 11, 2014
Finally got in some coding geez...and its tuesday lol
Finally got to do some coding and reading today. Added two different programs this time
https://github.com/s0nlxaftrsh0ck/BottlePrice
basically the same as Glazing calc but calculating bottle amounts. The 99 is to offset the division so as to not give me a 0 as it divides anything less than 100 wil be 0....a bit of a better explanation...
"If you just divide the number of tablets by 100 an integer division will give you the wrong answer (for any number of tablets less than 100 your program will tell you that 0 bottles are needed). One way to solve this is to add 99 to the number of tablets before you perform the division, forcing the number of bottles required to "round up" any number of tablets greater than 0."
and
https://github.com/s0nlxaftrsh0ck/FloatTest
This is a program for testing out casting where you tell the program you are sure you are changing it from a larger variable to a smaller one. Something like changing an int into a float.
A float is bigger than an int. If it was int > float there wouldn't be a problem.
But since its float we need to compact it i guess you could say into the int.
Thats...what i gathered so far anyways...
Next time will be if else statements. This refresher course is pretty damned helpful and im glad im taking it back from step one to solidify my understandings of what the hell i was doing in programming. That tis be it for now
https://github.com/s0nlxaftrsh0ck/BottlePrice
basically the same as Glazing calc but calculating bottle amounts. The 99 is to offset the division so as to not give me a 0 as it divides anything less than 100 wil be 0....a bit of a better explanation...
"If you just divide the number of tablets by 100 an integer division will give you the wrong answer (for any number of tablets less than 100 your program will tell you that 0 bottles are needed). One way to solve this is to add 99 to the number of tablets before you perform the division, forcing the number of bottles required to "round up" any number of tablets greater than 0."
and
https://github.com/s0nlxaftrsh0ck/FloatTest
This is a program for testing out casting where you tell the program you are sure you are changing it from a larger variable to a smaller one. Something like changing an int into a float.
A float is bigger than an int. If it was int > float there wouldn't be a problem.
But since its float we need to compact it i guess you could say into the int.
Thats...what i gathered so far anyways...
Next time will be if else statements. This refresher course is pretty damned helpful and im glad im taking it back from step one to solidify my understandings of what the hell i was doing in programming. That tis be it for now
Saturday, March 08, 2014
Trying to read while sleepy does not work at all...
No coding and very little bit of reading last night. But, i'm still insanely proud of my github and accomplishment ;p. Gonna try to get some reading and coding in today however.
Thursday, March 06, 2014
>.>;;;
Okay i snuck in one more shot at the github publish through bash and got it to work correctly this time!
https://github.com/s0nlxaftrsh0ck/GlazerCalc
^_^
I just had to let gitbash KNOW it's there as it's tacked as untracked. 'git add' my solution and director, do the git commit -m "add glazercalc.sln" but can't do that with the directory as it's done automatically when you push....
Add the remote origin of my git and do the git push...now why in the hell didn't the github do this...? So odd...is it only done through the bash i guess??? Hm...well these two spots helped guide me through this.
https://help.github.com/articles/create-a-repo
http://readwrite.com/2013/10/02/github-for-beginners-part-2
I hope no one will go "AUGHHH, if you're doing it why are you typing this out for?!?!?"
Honestly its kinda helping me remember. But now i have a feeling theres those who would be thinking "I wasn't thinking that!!!" And for that i apologize. You have permission to throw my cake on the ground on my birthday.
I should also just jot down notes too maybe...and also probably TAG THESE POSTS MAYBE?!?! Mrgrgr...ah well bed time for me.
-Ron
P.S. I'm not sure who else would even be reading this right now so who the hell am i even talking to?!
https://github.com/s0nlxaftrsh0ck/GlazerCalc
^_^
I just had to let gitbash KNOW it's there as it's tacked as untracked. 'git add' my solution and director, do the git commit -m "add glazercalc.sln" but can't do that with the directory as it's done automatically when you push....
Add the remote origin of my git and do the git push...now why in the hell didn't the github do this...? So odd...is it only done through the bash i guess??? Hm...well these two spots helped guide me through this.
https://help.github.com/articles/create-a-repo
http://readwrite.com/2013/10/02/github-for-beginners-part-2
I hope no one will go "AUGHHH, if you're doing it why are you typing this out for?!?!?"
Honestly its kinda helping me remember. But now i have a feeling theres those who would be thinking "I wasn't thinking that!!!" And for that i apologize. You have permission to throw my cake on the ground on my birthday.
I should also just jot down notes too maybe...and also probably TAG THESE POSTS MAYBE?!?! Mrgrgr...ah well bed time for me.
-Ron
P.S. I'm not sure who else would even be reading this right now so who the hell am i even talking to?!
Finally added some coding and ran it. And it worked out. Also got it soooomewhat running up on github as well and pushed it out. Again somewhat...lol. Honestly as i was typing the code out in visual studio i kept smirking at how the autocompletes work and i missed doing this type of stuff and was pretty damned happy about it. Everytime i looked at my e-mail i had an ssh key for my GitHub and it kept reminding me of what i had to do tonight. Felt pretty good i gotta say. So yeah got a program up and pushed out a repo...somewhat. Maybe it didn't sync up correctly? I don't know...
https://github.com/s0nlxaftrsh0ck/GlazerCalc
Very odd...yeah i still need to mess around with how to push stuff out to git hub. But heres the code of the first program from the book
1 + using System;
2 +
3 + class GlazerCalc
4 + {
5 + static void Main()
6 + {
7 + double width, height, woodLength, glassArea;
8 + string widthString, heightString;
9 +
10 + widthString = Console.ReadLine();
11 + width = double.Parse(widthString);
12 +
13 + heightString = Console.ReadLine();
14 + height = double.Parse(heightString);
15 +
16 + woodLength = 2 * (width + height) * 3.25;
17 + glassArea = 2 * (width * height);
18 +
19 + Console.WriteLine("The length of the wood is " +
20 + woodLength + " feet");
21 + Console.WriteLine("The area of the glass is " +
22 + glassArea + " square metres");
23 + }
24 + }
25 +
Obviously not my code or anything modded about it. Just straight from the book.
By the way there are a lot of coders around the IT Department of me. And i see them coding and i'm like...man i wish i could do that right now. Yeah the Sys Admin stuff is fun but seeing those lines of code just looking so neat and perfect and the colors. yeah...i think i'm gonna have fun honestly.
-Ron
Subscribe to:
Posts (Atom)