Programming

-=Punisher=-

Poster
Joined
Dec 2, 2008
Messages
226
Ive recently got back into programming and taking a C Programming at college. Im going for a Computers and Electronic Engineering degree but I really wanna be in Information Tech for software apps and dev. Its a long story but Im still getting my engineering degree and was wondering if there are any members that know the roundabouts of programming in C and possibly Java and C+ as Id like to try learning myself.
 
I know a little Java. Sadly, I've forgotten most of it due to the fact I never finished the course because that was the year that I had to duck out of school and be home schooled, but I remember a few things. I still have an unfinished beta of a game I was working on here somewhere, the teacher picked the top 3 out of the class which included me and said that while it wasn't part of the curriculum, if we were up to it he'd let us work on a game together during lunch or after school. One of the others was a little too busy, but me and my friend Lukas set out to work on it, and my wife Chie swung in to help with the design. The game itself was going to be a text based adventure/RPG mix. The "Dice engine" that Lukas cooked up for the combat was based on Fallout and D20 Modern. The Dice Engine was actually working pretty well, but when one STUPID variable popped up he quit the project and it fell apart. All he had to do was make an exception in the code. There was a rule in the combat system that during combat, both the player and the monster(s) had to take at least one turn before either party could die. However, if the monster was a Shallow (Zombie like creature), and the player was able to get a lucky headshot with a weapon, the monster would die instantly. Naturally this caused the Dice Engine to get confused, since it was told that the monster had to take at least one turn before it could die. All he had to do was add in an exception, but he thought it was "impossible."

The project does still live on, but not as a game. The story elements were assimilated into the novel I'm writing.
 
grades are great, just i want to get more exp with other languages lol... btw posting on my wii so sorry... is there a compiler or such for java like there is pelles c for c?
 
I program in c/c++ daily. It's been awhile since I did any java
 
i work with C++ with qt bindings and a few scripting languages like python and php
 
Im just learning how to code. Im using Visual Basic so im not much of a help :P.
 
Im in CS161 and we're using BlueJ, simpler than others but its works.

Right now Im just learning Classes, objects, methods, constructors, fields, etc...
 
JCreator LE is a good IDE for Java, I've used it for over 6 years.
I don't know if you can find it online anymore, if you want it just shoot me a PM and I'll pull it off my old flashdrive. (Note: If you do manage to get it search for "button from hell" once you've installed it and delete it, it's corrupted on EVERY download)

I got burned out on Java because the interface for Windows is stupid and doesn't run very fast because it's being emulated. All my Java programming now is done for web apps and mobile phones, but more specifically just my blackberry.

Java is a good starting point for learning OTHER languages because it is OS-Independent, but for anything that needs more control I use C/C++.
 
Im just learning how to code. Im using Visual Basic so im not much of a help :P.

That was my very first programming class and absolutely loved it. Its what got me interested in this stuff. If you have questions feel free to ask here.
 
J

I got burned out on Java because the interface for Windows is stupid and doesn't run very fast because it's being emulated. All my Java programming now is done for web apps and mobile phones, but more specifically just my blackberry.

I've been seeing that "thought" on more and more people. It seems like that is being used more back end .net interfaces and less for 'windows' programing.
 
So Ive got my Final Project yesterday and have been working on it for 4 hours so far today and Im stuck on figuring out why im getting all these errors.
 
Ive got it figured out so far I think, but when I run the program up to this point by pushing P to play it just outputs the menu again.
* Bleh after reading it after the post all the newlines are just n's and those are ok, Im sure of it.


#include <stdio.h>
#include <stdlib.h>
#include <time.h>

int a =1, d1, d2;
int print_opening_msg(void);
void display_rules(void);
void show_menu(void);
int roll_dice(void);
int show_die(int, int);
char rulesans, option, dummy;

int main(void)
{
srand(time(NULL));
while(a==1)
print_opening_msg();
return 0;
}

int print_opening_msg()
{
printf("Welcome to Craps v1.0 Get ready to get your game on!nn");
show_menu();
return 0;
}

void show_menu(void)
{
char choice;

do
{
printf("nnMenunn");
printf("P = Playn");
printf("R = Rulesn");
printf("Q = Quitnn");
scanf("%c%c",&choice, &dummy);

switch(choice)
{
case 'P': roll_dice();
break;
case 'R': display_rules();
break;
case 'Q': printf("Quitting Game!n");
exit(0);
break;
default: printf("Invalid choice!n");
break;
}

} while (choice != 'Q' || 'R');

}

void display_rules(void)
{
printf("A player rolls 2 6-sided dice of which the sum of the dice is calculated.nn");
printf("If the sum is 7 or 11 on the first roll, the player wins.nn");
printf("If the sum is 2, 3, or 12 on the first roll, the player loses.nn");
printf("If the sum is other than above on the first roll, nthen the sum is known as the "point".nn");
printf("The player then continues rolling the dice attempting to nobtain the "point" value.nn");
printf("If the player rolls a 7 on any subsequent roll attempting to n"make the point", the player loses.nn");
printf("Do you understand these rules? ");
scanf("%c%c", &rulesans, &dummy);
switch(rulesans)
{
case 'Y': show_menu();
break;
case 'N': display_rules();
break;
default: display_rules();
}
}

int roll_dice()
{

d1 = rand() % 6 + 1;
d2 = rand() % 6 + 1;

return d1+ d2;
}

int show_die(int d1, int d2)
{
printf("%d die 1", d1);
printf("%d die 2", d2);

return 0;
}
 
Back
Top