Advertisement Jump to content
  • Advertisement

Charles Jarret Grassi

  • Content Count

  • Joined

  • Last visited

Community Reputation

147 Neutral

About Charles Jarret Grassi

  • Rank
  1. Charles Jarret Grassi

    How does somebody go about designing a program

    One good way to outline a program, to determine the basic functions you might need, is to use a hierarchy chart. I can elaborate more if you'd like, but it basically has 4 Main points to the top tiers of the chart. You have the name of the program, basically what your goal is and what you want to output, then you break it into three categories; Set up, run time, and finish. Under those three tiers, you branch out and consider what you would need, in it's most basic form, under each tier. Such as if you were to make a simple program run and execute "Hello world", you'd have the three main points branched under the "MAIN" function (using C jargon, forgive me if your forte is another language). The first step, you'd just want the simple print function to output the text "Hello world!", then you'd do your basic clean up stuff. The main printing step would be under the first tier, and the finishing up "return" statement would be under the "finish" tier. The main reason you'd use something like this is to neatly visualize the basics of how you want your program to function. It's extremely useful in larger projects so you can outline how you want each program to work. From there, you'd usually make a program skeleton then fill out the "meat and potatoes" of the rest of the program once you've decided which parts of the program you'd want to turn into functions, structures, classes, objects, etc, and what else would be just straight up code. I'll try and add an example of what I mean in another post tomorrow if you would like one. As is, I'm pretty tired and I need to get up early tomorrow and figure out what's wrong with my eye... hopefully nothing bad. I need these eyes to be able to see my code. >;[
  2. Charles Jarret Grassi

    So I've learned C...

    Man. I love you guys so much. No matter what questions I throw out there, I always get a mass of intelligent people such as yourselves giving me your two-cents and leading me on to be a better programmer. I can't thank you guys enough for all of the patient guidance you guys have provided me within the last month-or-less of me being a member on this forum. I really hope that I can pay you guys back some how, be it some free-lance programming or even some sensual serenading (I was a music major before i switched to computers ;D). As it stands now, I do believe I'll pick up Java as I'm learning more of c. I'm gonna continue to study C and maybe mess around and develop a bit of a Interactive Fiction style program game that's easy to go through and run but has some complexities that make the program more efficent. But a curious question that has been bugging me for the last few months is this; Is there a way to blend languages together? I had a recent conversation with a new found friend of mine, not a half hour ago (Mind you, I'm sitting in the student center at my local community college enjoying a nice, tachicardia-enducing energy drink) who spoke of . He said that in the language they use a lot of C#. I responded "Do I need to learn C# to learn asp?" and he said firmly, "ASP is a language on it's own... It's very hard to explain." So... yeah. I'm a bit confused as to his response, so I shall ask you, my fellow quick-witted, ingenious, and handsome bretheren... Is there a way to use one programming language in another programming language? Such as being able to write C in Java... etc. etc. And please do explain more about what he meant with ASP.
  3. Charles Jarret Grassi

    So I've learned C...

    After learning the basics of the C Language, I don't quite know what to do with myself. I mean, I've been craving to start SOMETHING and I've already made myself a basic stat roller for Dungeons and Dragons and the basic programs assigned to me by my professor. But I don't know where to go from here. I've heard many stories that Learning C or C++ as your first language is not exactly the best thing to do since the learning curve can be very steep for some, but I've had no qualms with it. Maybe I'm an exception? Or maybe I don't quite understand it as well as I think. I'm not sure, but I've come to gamedev to ask you masters of the keyboard to guide me in the right direction. I've been wanting to get into learning Java, I'm going to try and take a class for it next quarter (if I pass this quarter's intro to C [Damn my laziness]) and I'm not sure if that's where I want to go. I would love to take up programming professionally, I just am not sure what exacty I want to do with the knowledge I'm collecting. I know that C, so far, is very memory based and seemingly more intricate than the programming I had invisioned, but I find it extremely fun. I would like to be able to use C and C++ in some way, shape, or form. I kind of invision myself to be one of those guys that makes game engines like the unreal engine or something. I always thought it would be cool to be the un-sung heroes of the gaming world, making some of the fastest, most powerful gaming tools on the market. But then again, I also want to be a rock star... so you can see my indecisiveness. Anyway, i'm merely rambling as I always do. My point is... Where do you guys think I should go next? Do you think that I could take another class of c and c++ and be able to find a programming job this way? Or do I need to learn a lot more languages before I can even consider turning in an application for even the lowest levels of the programming profession.
  4. Charles Jarret Grassi

    What language does what?

    Hey there, Monkayy, I had the same problem as you when I started looking for a programming language to learn a few months ago. I started with C++ and that seemed to get me along just fine. I spent like thirty dollars on a beginners guide for dummies to c++ and it displayed all of the basics with variables, functions, and some OOP (Object Oriented Programming) that got me started with my current major. I'm studying for a Bachelors (Possibly Masters or Doctorate), depending on my career path in the future, and have taken up classes in basic C. Learning C++ was a great choice since they're the same language, just more advanced features in c++, and am doing fine as is. I would definitely suggest learning something that's most comfortable for you with the syntax. I'd add more but I gotta go to work! I'll add more when I get back home if this post still has a pulse. - Jarret
  5. Charles Jarret Grassi

    Trying to write a basic D&D Character sheet program.

    Oh and thank you, RulerofNothing, for the Roll code. You're code is the meat and potatoes of my program. Haha.
  6. Charles Jarret Grassi

    Trying to write a basic D&D Character sheet program.

    I actually just finished my basic character sheet program today. I wrote it in about an hour. I'm proud of myself since it does everything that I want it to do so far. I want to add a few more things to it as I tinker around with strings and arrays so I can add in some racial text (Such as if you're an elf, dwarf, etc etc) and then possibly add more to the application, like re-rolling certain stats and stuff. Here's my code, (Warning, it's kinda big) /* Program : CharacterSheet.ccp Author : Charles Jarret Grassi Date : 9/30/2012 Version : 1.0 Desc : A Dungeons and Dragons Character Ability Score automated roller, using a 4d6 stat engine to get even, balanced stats for the six categories; Strength, Constitution, Dexterity, Intelligcen, Wisdom, and Charisma Use it wisely! Soon to come : - Add "Host and Player" lines to the top - Add Races, Background, and Equipment - Add a secondary program; "Encounters" - A name Randomizer - Editable interface. */ #include <cstdio> #include <cstdlib> #include <iostream> #include <time.h> using namespace std; int main() { FILE * pFile; pFile = fopen("CharacterSheet.txt","w"); fprintf(pFile, " DUNGEONS & DRAGONS - Character Sheet "); fprintf(pFile, "\n\n Strength: Modifier [ ] "); fprintf(pFile, "\n\n Dexterity: Modifier [ ] "); fprintf(pFile, "\n\n Constitution: Modifier [ ] "); fprintf(pFile, "\n\n Intelligence: Modifier [ ] "); fprintf(pFile, "\n\n Wisdom: Modifier [ ] "); fprintf(pFile, "\n\n Charisma: Modifier [ ] \n"); int nInput; printf("\n\n Welcome to the Dungeons and Dragons AP roller! "); printf("\nThe program has been executed and is storing stats "); printf("inside of a 'character.txt' file inside this folder."); printf("\n\n You will recieve the raw ability scores with the "); printf("modifiers beside the stat. You may allocate the stats"); printf("within any core stat you may like. If you have recieved"); printf("a bad score, exit the program and run it again. :3 "); printf("\n\n If you wish to save this sheet without deleting the stats"); printf(", make sure you change the name of the text file before running"); printf(" the program again, otherwise it will delete all of the data stored"); printf(" inside the text file and write over it. "); printf("\n\n======Developed by Dragon Master INC.======"); printf("\n\n Press 0 to exit the program. Press any other key to continue. "); scanf("%d", &nInput); if(nInput == 0) { exit(0); } srand( time(NULL) ); for(int nAccu = 0; nAccu < 6; ++nAccu) { int nMod; int nStat = 0; int nMin = 7; for(int nAccumulator = 0; nAccumulator < 4; nAccumulator++) { printf("\n\n Rolling..."); // Make sure not to seed a rand inside of a loop // the results will be the same every time. int nRoll = rand() % 6 + 1; cout << "\n nRoll = " << nRoll; if(nRoll < nMin) { nMin = nRoll; } nStat += nRoll; } nStat -= nMin; printf("\n\n Stat : %d \n\n", nStat); nMod = (nStat - 10)/2; printf(" Modifier : %d \n\n", nMod); printf(" Outer Loop Accu : %d \n\n", nAccu); fprintf(pFile, "\n Stat : %d \n Modifier : %d \n ", nStat, nMod); // Listing the stats on the page via switching. (Neater. ) } fclose(pFile); printf("\n\n\n !END!"); system("PAUSE"); return(0); } If you can't already tell, it just uses some basic loops to generate the rolls, stores them in the stat and then prints them all to a text file. My friends were extremely impressed since they don't know how to program. I felt like a badass. But yeah, I'm going to study these class functions that you were describing and hopefully tinker around with them so they make sense to me. xD -Edit- I apologize if my coding is sort of sloppy. I threw it together while in a crunch to start building character sheets for my friends, and instead of doing things the easy way and just rolling stats, I had to make things harder for myself and make a program to do it. xD. So any comments that don't seem to fit, just ignore them. I had differnet mind sets on how I wanted the stats to be printed onto the text file, such as using a switch inside the loop to print out each stat name with the rolled stat and modifier, but it ended up printing out each stat six times which didn't work, so I just threw the stat names down at the top of the program just to be neat.
  7. Charles Jarret Grassi

    Trying to write a basic D&D Character sheet program.

    Could you explain what those std::array and std::generate things are? I'm guessing those are class things? I'm not that far into c++ or c to quite understand what those mean, but I know about randomizing numbers and seeding and such. If it's not too much trouble, could you elaborate what's going on?
  8. Charles Jarret Grassi

    What to use for c# games and

    Hey, man. I'm kinda in the same boat, trying to figure out what skills would be best for me to diversify myself professionally and as a programming nerd. I took up C++ myself, although I've been itching to pick up C# since I used Unity, which is a great free game developing program, for a tad bit to tinker with. Although using applications wasn't really my thing, I have this strange want to start everything from scratch, i decided to try making my own applications. I just started teaching myself programming about a month ago and have started taking a class for C. I see that you're trying to get into EVERYTHING at once, and I think that's great, but if I were you I'd definitely try and focus on one thing at a time. Simply put, if you want to be a one man army, you gotta get one thing down before you can start breaking the walls with your mad skills. I mean, that's how I'm approaching this anyway. You could be a damned genius for all I know.
  9. Charles Jarret Grassi

    Trying to write a basic D&D Character sheet program.

    I always seem to over complicate things in my brain. -smh
  10. Charles Jarret Grassi

    Trying to write a basic D&D Character sheet program.

    Dude. You're a genius. Thank you!
  11. Charles Jarret Grassi

    Trying to write a basic D&D Character sheet program.

    And to clarify, when you roll an ability score for a d20 based dungeons and dragons character sheet, you just roll four six-sided dice and remove the lowest number, then add up the total of the three remaining dice. if you happen to roll all sixes or a multiple of the lowest number, you would just take out one of the dice, or one of the multiples, and then add them up. That's what i'm trying to achieve in a simple function that I can print out onto the text file without having the players have to manually do it, which is time consuming. I said all this assuming you've never played D&D or any Tabletop rpg, but if you have then this is redundant. Haha.
  12. Charles Jarret Grassi

    Trying to write a basic D&D Character sheet program.

    How would one do that quick sort? I was doodling on my white board trying to figure out the best possible way to sort out the random integers that would remove the lowest integer out of the four numbers without removing more than the one integer if it were to roll multiples of the same integer. I was messing around with trying to divide down the average of the rolls, but I always seemed to take out more or less than I needed out of the average. Such as if it were to randomize the integers 4, 3, 6, 2, I'd add them up into a variable, then divide it by the number of rolls and then remove that from the sum of the four. But that never worked. Could you explain what you mean by that quick sort?
  13. Charles Jarret Grassi

    So I finished the Game From Scratch Tutorial

    Yay bytes! I just recently was in an 'Intro to C' class and we were talking about bytes and how a 'char' is only one byte. Then we got into a rant about the pronnunciation of char, whether it should be 'ch-arr' or 'k-air', then some how got into talking about pokemon. That's Community College programming for ya.
  14. Hey, guys. This is my first post so I hope that this goes well, otherwise I will find myself in the corner of my faded-blue room sobbing profusely. So I'm trying to write, with my limited knowledge of c and c++ (the latter I taught myself the basics in a few weeks over the summer), a somewhat-basic D&D Character sheet program. The concept is somewhat skewed since my mind can't seem to wrap around what I want to achieve when rolling for ability scores and such. So far, I'm just striving for a simple program that can execute(Of course, without failing), take the input of the character's name, race, and possibly pick some storyline options, and then output them onto a .txt file on their desktop (which I'm trying to find a way to do through precise direction of the fopen deal), and such and such. Sorry if this seems a bit mushy, I haven't slept much. Ha... Anyway, what I'm trying to ask is; How would one randomize four integers, being equal to that of a six sided dice, and then take the four numbers I get and remove the lowest integer, then add them together? I can't seem to wrap my brain around how I could pick out the lowest integer if something happens to come up the same, such as two fours, and two fives, how would i code it to remove just one of the fours, not both of them, so someone doesn't get the ability score of Ten? If none of what I have just asked makes sense, I'm willing to answer any questions you might have. And I know of the rule about no homework assignments on here, so to let you guys know this is strictly for pleasure. I'm trying to impress my RP Crew with this simple executable program that everyone can use to make five character sheets in five minutes instead of taking about 4 hours. If someone can help me piece this together, I should be able to make an efficent program. Hopefully!
  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!