Showing posts with label sortof. Show all posts
Showing posts with label sortof. Show all posts

Tuesday, December 27, 2016

Catching Up on Life Things

My interest in programming has not waned over the course of these last months, though I consistently hit walls and take extended breaks from learning anything new. It is the harsh struggle of learning something without the looming threat of deadlines or the presence of a mentor.

While I feel as though I haven't made much progress on my own, I have taken steps towards securing my learning capabilities. I've enrolled in courses at a new STEM school locally. Well, sort of locally. I commute an hour to attend, but my degree concentration is Computer Science and Game Design. I am well on my way to having a well-rounded education on software engineering with a focus on what makes games what they are. I would have never imagined pursuing a Bachelor's degree in Comp Sci when I graduated from high school.

My first semester left little time for me to pursue anything programming-related (damn prerequisites), but now that the semester is over, I've been cramming everything I can get my hands on about C, trying to beat the clock on these last two weeks of winter break before I start back in with a Python introduction course. My school won't teach C, but will instead jump from Python to C++ to Java. It doesn't bother me, though. C and C++ are both powerful in their own ways and I'll only benefit by learning them both. I figure I'll just skate through Java and apply the programming theory I learn to the other languages I know.

Still, I've come to realize that blogging about programming was helpful while I was actively posting about a couple of years ago. While I work on a personal project related to MUDs, I'll start trying to more actively discuss what I'm learning. So, yay! Activity!

Other life-things going on? I'm happily married now. My husband and I live with my best friend and we play Overwatch together A LOT. I lowkey enjoy Widowmaker but I'm a Zenyatta main. Might be getting back into GW2 or World of Warcraft (???) if school and projects allow, but it's probably not the greatest idea to do either of those things, considering I already moan about not having time to do stuff! I've also discovered that having just a few years of art experience has made me very valuable at school, and I'm glad to have a bit of versatility. I've done more art for game projects this semester than I thought I would and it was a lot of fun. I may post some of those up here. Since the last time I posted, I found a new favorite book series (Patrick Rothfuss's "The Name of the Wind") and I have written an enormous amount of prose for my own characters, as well as designed some content for the eventual MUD I will host.

Will I get around to posting again today? Who knows! But the next post I make will definitely be more interesting than this one.

Monday, March 7, 2016

From October 2, 2015

I apparently had this written back in October of last year when I was working on a calendar program in C, but I never posted it because it was titled "To be written tomorrow..." and I obviously got fucking distracted. Anyway, here's my (very likely hackish) calendar program.

After mulling over this ALL day, here is the answer I've come up with for this programming project.

/* Write a program that prints a calendar. */

#include <stdio.h>

int main (int argc, char* argv[]) {

    int days_month, week_begin, var1, var2;

    printf("Enter the number of days in the month: ");
    scanf("%d", &days_month);
    printf("Enter the day of the week the first day falls upon (1=Sun, 7=Sat): ");
    scanf("%d", &week_begin);

    var2 = 1;
    while (week_begin > var2) {
        printf("   ");
        var2++;
    }

    for (var1 = 1; days_month >= var1; var1++, ++week_begin) {
        printf("%3d", var1);
        if (week_begin >= 7) {
            printf("\n");
            week_begin -= 7;
        }
    }
    printf("\n");

return 0;
}

I looked up the answer in the book answer key and 50% of my program is almost identical to the author's program. Woohoo!
Unfortunately, that last gnarly bit with the if statement is vastly different from his. He used all sorts of maths like remainder and variables - 1 * variables to get his answer. I can't see the relationships of numbers quite that easily... yet. :(

Wednesday, May 22, 2013

Update and Blabbering

I'm finding it pretty amusing that, after picking up K&R, I haven't been using King nearly as much. K&R is so concise that it teaches you a LOT in a small amount of time. King is much more expository in style. I think K&R is the best choice if you can keep up with them, but if you don't know what an operand is (or some other term that is used in K&R, I only used that as an example), you will probably cause yourself less grief if you go with a more detailed approach.

Now that I'm reading through, I'm finding that I can skip over huge sections of King. I think I may use King as an extra workbook, at this rate, but it is still good reading that doesn't assume that you already know what you're doing (example: declarations really do need to go before the statements every time. K&R assumes the reader knows this; King spells it out, just in case.).

I haven't posted here in a couple of days because I got into a creative rut, and because I got busy at work. The busy-ness at work comes and goes -- I'm thankful for the time I can spend on personal projects, but I do still have to pay attention to some things (and, occasionally, those things get overlooked because I'd rather be working on anything else coding... Heh...).

The creative rut is exciting, so I let it wrap me up for longer when I get stuck in it. These past couple of days have been filled with gaming, but also with writing. My fiance and I are putting ideas down on paper (at last!), and I'm excited to be weaving his thoughts and my thoughts together. We've been talking about this project for the better part of a month now, and it feels good to be making some solid progress on it. This is the same project that spurred my interest and dedication to learning to code in C.

Anyway, this is somewhat of a rambling post. I'm resisting the urge to monetize this blog, despite how popular it seems to be so far. I know how ads can kill something enjoyable... Of course, that's assuming my rambling is actually enjoyable to any of the people who stop by here haha.

Possibly going to do some exercises today! I'm going to make an effort, anyway! But a good friend is coming to visit, tonight, and there will be chinese buffet and Star Trek movie goodness. That may not leave much room for coding practice. XD

Monday, May 20, 2013

Xcode

Seeing as I do a fair bit of work on my Mac partition, I took the plunge and downloaded an IDE called Xcode.

I wanted to share some of the things I've discovered today while poking around with this powerful application:

  1. IDEs will require some sort of learning curve. Luckily, this one is very straight-forward, but I haven't investigated any for Windows or Linux systems yet. Yeah, go figure that after being so excited to get Linux on my zombiemac, I'm using Mac OSX more...
  2. There is a LOT of good information in the documentation for the IDEs, but chances are, you'll need to sift to get to what you're trying to figure out. The communities are pretty tight-lipped, it seems, and that's understandable. I think, perhaps, they want to protect the diminishing quality of really good coders who legitimately want to know what they're doing. But, that could be a brash opinion from a novice who doesn't really know the communities very well.
  3. For the kind of coding that is tackled in K&R and King, there really don't need to be any shiny bells and whistles. In Xcode, at least, just enter these programs into a "Command Line Tool". It uses C libraries automatically and opens up a Terminal window to produce the effects of the program. I have no idea if other IDEs will have settings like these, though.
  4. I just want to put this out there; Don't forget to compile the code after you've made a change. Seriously, you can make every change you want, but if you don't compile it after, it won't have any effect on your output. I found this out the hard way, despite this being a kind of common-sense thing (and I'm absolutely certain I've read it somewhere before and just forgot with the excitement of having things WORK in Xcode haha).
  5. Xcode can do a LOT of things. The other IDEs you might find are also designed to handle a TON of work. As with anything, take small steps and try not to get overwhelmed. If you don't need a feature (like a graphical interface), don't learn about how to code it right away!
Anyway, now that that's out of the way, here are a few things I was playing around with today. GO FIGURE that "hello, world!" was actually the program that fell victim to my lack of good knowledge with Xcode. After I got the F/C conversion table working, I didn't feel like I needed to go back and do it again, heh.


I'm hoping this can be read clearly enough... (Pro Tip: Open in New Tab, it will let you zoom reeeeal close)

The example to the far left is the original program. It takes the Fahrenheit values, in increments of 20, and calculates the Celsius value by using the algebraic formula.

The middle example converts the integers (int) of Fahrenheit and Celsius into floating-point numbers, so they can be converted with more accuracy. Floating-point numbers allow the usage of decimals.

The right-hand example shows an addition that was suggested by K&R as an exercise; a header to the table.

The next topic in K&R is the for statement. Yay for being excited to carry on with coding before delving into video games! I actually made my fiance go play ToR by himself after dinner so I could work on this stuff! Haha.