I have known many more people who gave up on C and general programming than Python...
The Big Programming Thread - Page 163
Forum Index > General Forum |
Thread Rules 1. This is not a "do my homework for me" thread. If you have specific questions, ask, but don't post an assignment or homework problem and expect an exact solution. 2. No recruiting for your cockamamie projects (you won't replace facebook with 3 dudes you found on the internet and $20) 3. If you can't articulate why a language is bad, don't start slinging shit about it. Just remember that nothing is worse than making CSS IE6 compatible. 4. Use [code] tags to format code blocks. | ||
Sub40APM
6336 Posts
I have known many more people who gave up on C and general programming than Python... | ||
phar
United States1080 Posts
I would also argue that C is not a bottom-up approach. If you really want to understand wtf is going on, go like... E&M -> transistors -> architecture -> C. But, not everybody is going to want to learn the really low-level stuff. There are some people who find it fascinating (I am one of those people), but people think it's boring as ungodly fuck. Also, most of the low level shit just does not matter for 99.9% of the software you do at a high level. Being able to modularize your code, use good designs, and make it readable so other people can mess with it is much more important (where "other people" == "you in 6 months", after you've completely forgotten wtf those 10k loc do). All that said, if you continue programming, you really should learn C eventually because it's good for you :p | ||
wherebugsgo
Japan10647 Posts
I come from a strong Lisp (Scheme specifically) background and I know Python fairly well in addition. I need to learn Java this semester. Very basic general stuff can be helpful for me. I like knowing the constraints or specifics of a language regarding its very basic ideas: things like, in Lisp everything has the value #t except for #f, whether doing tail-recursion has any benefits over regular recursion, (in Python tail-recursion has no benefit) syntax things to consider (parentheses in Lisp anyone? Also the fucking colons after all the loops in Python kept screwing me over lol) | ||
Tobberoth
Sweden6375 Posts
On September 04 2012 16:34 wherebugsgo wrote: anyone have any tips on learning Java? I come from a strong Lisp (Scheme specifically) background and I know Python fairly well in addition. I need to learn Java this semester. Very basic general stuff can be helpful for me. I like knowing the constraints or specifics of a language regarding its very basic ideas: things like, in Lisp everything has the value #t except for #f, whether doing tail-recursion has any benefits over regular recursion, (in Python tail-recursion has no benefit) syntax things to consider (parentheses in Lisp anyone? Also the fucking colons after all the loops in Python kept screwing me over lol) Generally, I'd say you'll want "high-level" books since you already know how to program and prefer the more technical aspects... I guess an o'rielly book or something like that. It's also possible that Java has something like all of microsofts products, certification tests etc. The books etc for those, are the SHIT. Since the company which developed the framework etc aims to get you certified, they teach more or less everything from the ground up. Instead of going "How to start coding in X" you go "How to know everything about X". | ||
wherebugsgo
Japan10647 Posts
On September 04 2012 16:54 Tobberoth wrote: Generally, I'd say you'll want "high-level" books since you already know how to program and prefer the more technical aspects... I guess an o'rielly book or something like that. It's also possible that Java has something like all of microsofts products, certification tests etc. The books etc for those, are the SHIT. Since the company which developed the framework etc aims to get you certified, they teach more or less everything from the ground up. Instead of going "How to start coding in X" you go "How to know everything about X". Yeah so our "official" book is Head First Java (O'Reilly) and it's been recommended we check out the Gosling reference (since he created the language). I take it O'Reilly's text is a good book? This stuff is a bit foreign to me as I didn't really use a text to learn Python and I used MIT's text to learn Scheme. | ||
phar
United States1080 Posts
On September 04 2012 16:34 wherebugsgo wrote: anyone have any tips on learning Java? I come from a strong Lisp (Scheme specifically) background and I know Python fairly well in addition. I need to learn Java this semester. Very basic general stuff can be helpful for me. I like knowing the constraints or specifics of a language regarding its very basic ideas: things like, in Lisp everything has the value #t except for #f, whether doing tail-recursion has any benefits over regular recursion, (in Python tail-recursion has no benefit) syntax things to consider (parentheses in Lisp anyone? Also the fucking colons after all the loops in Python kept screwing me over lol) Do you know C at all? If you know C, you already know many of the basic constraints in java, especially if you're talking about syntax. If you're any decent at the proper OO constructions in python, it won't be that hard to transition into java. The official sun tutorials are pretty decent for a first start: http://docs.oracle.com/javase/tutorial/ s/sun/oracle/ ![]() There's an excellent reference - Effective Java, but I'm not sure it's suitable for learning the basics. It's by Joshua Bloch, who wrote significant portions of the java language (the good parts too :p). Yea reading through bits of it right now, doesn't seem like it'd be that useful for you. Start with a basic text or the official tutorials and see how it goes. I also strongly suggest that you start off on the right foot and follow an actual style guide (pick one), even while you're first learning. It won't teach you anything about the language itself, but it will help other people be able to help you with your code when you inevitably have to ask for help (everyone does). official one: http://www.oracle.com/technetwork/java/javase/documentation/codeconvtoc-136057.html Really though, just start hacking with it. Reading a book or guide isn't gonna go that far. Mess around, build shit, break stuff, ask for help. | ||
wherebugsgo
Japan10647 Posts
Thanks for the references! I'll definitely check them out. | ||
Frigo
Hungary1023 Posts
| ||
wherebugsgo
Japan10647 Posts
On September 05 2012 18:24 Frigo wrote: I also advise you to read Clean Code and learn how to use Eclipse and its various refactor options. Don't think I'll be using Eclipse, I like emacs too much :p | ||
LukeNukeEm
31 Posts
edit: as usual, you try to find the answer on your own for hours and get nothing. then you post your question and find the answer on your own 5 minutes later. ^_^ | ||
DarkGeneral
Canada328 Posts
![]() A few weeks ago I decided that I wanted to learn and master HTML/CSS/Javascript and SQL. To solidify my learnings as I went forward, I started a web based game project. My project is Knights of Drakon, a top down oldschool RPG written entirely in JavaScript/html/css. Link to my game The reason I come here is to ask for some advice from seasoned programmers regarding certain game parts. Im gonna just ask my questions and hope someone will answer ![]() 1. How do I code an Armor mitigation function/class? For example the player has 112 armor, and is level 4, the enemy is lvl 6. How do I make it that 112 turns into a certain % reduction? such that more player/monster level difference affects the % and also the more the static armor, the less stacking effect it has, such as a diminishing return or a softcap 2. Same as above for a dodge system. 3. Whats the best way to code a turn based 1v1 combat versus a monster. Player attacks, then the monster attacks, so on so forth, untill one is dead. I know this one is a broad scope question, But ANY idea and input is greatly appreciated ![]() Furthermore and possibly off topic, I have my hands full and would appreciate people partnering up with me and contributing to the site, Id love experienced people in all backgrounds, Arists, Coders, Webmaster, Gamedesigners, Level Designers, and someone to help me set up forums for the project, email me from the site or PM here Thanks TL | ||
LukeNukeEm
31 Posts
On September 06 2012 09:01 DarkGeneral wrote: 1. How do I code an Armor mitigation function/class? For example the player has 112 armor, and is level 4, the enemy is lvl 6. How do I make it that 112 turns into a certain % reduction? such that more player/monster level difference affects the % and also the more the static armor, the less stacking effect it has, such as a diminishing return or a softcap You could do something like: dmgModifier = 100 / (100 + armor); dmgOut = dmgModifier * dmgIn; Adjust the numbers to what you feel works best for you. | ||
DarkGeneral
Canada328 Posts
On September 06 2012 09:27 LukeNukeEm wrote: You could do something like: dmgModifier = 100 / (100 + armor); dmgOut = dmgModifier * dmgIn; Adjust the numbers to what you feel works best for you. Sweet, I like that. Any ideas on how to play level difference into this calculation? | ||
LukeNukeEm
31 Posts
On September 06 2012 09:46 DarkGeneral wrote: Sweet, I like that. Any ideas on how to play level difference into this calculation? Just do the same thing again - pretend that each level is worth 50 armor or so. either work it in the existing modifier, or create a new one and multiply both, e.g: lvlDiffModifier = 100 / (100 + 50 * lvlDiff); dmgOut = armorModifier * lvlDiffModifier * dmgIn | ||
Brutland
United States92 Posts
dmgOut=dmgIn*dmgMod LvlMod= abs(charLvl-oppLvl)*whatever percent or modifying fn here | ||
LukeNukeEm
31 Posts
On September 06 2012 09:54 Brutland wrote: dmgMod= abs((oppLvl-charLvl))*(100/(100+cArmor) dmgOut=dmgIn*dmgMod this would result in getting the same modifiers for lvl4 vs lvl6 / lvl 6 vs lvl 4 | ||
Craton
United States17234 Posts
On September 05 2012 16:50 wherebugsgo wrote: yeah, I have 0 experience with C. Having programmed a bit in Java today (I finished a few small functions, one that finds sociable pairs) I feel more comfortable, but it's still a little weird having to denote what variables are before using them and whatnot. Thanks for the references! I'll definitely check them out. It feels weird as hell not to when you started the other way. | ||
DarkGeneral
Canada328 Posts
On September 06 2012 09:53 LukeNukeEm wrote: Just do the same thing again - pretend that each level is worth 50 armor or so. either work it in the existing modifier, or create a new one and multiply both, e.g: lvlDiffModifier = 100 / (100 + 50 * lvlDiff); dmgOut = armorModifier * lvlDiffModifier * dmgIn Beautiful simplcity, now for the last aspect, how would I implement diminishing returns? As the number increases and the % approaches lets say 70% the % amount per armor point would have to curve down, what is the best way to do that? | ||
phar
United States1080 Posts
On September 06 2012 00:43 wherebugsgo wrote: Don't think I'll be using Eclipse, I like emacs too much :p Eclipse is a huge timesaver for Java. If you're not going to be writing that much code it won't matter, but if you have to crank out like 4k loc a week, Eclipse helps with the RSI :\ If this is for ar Uni class, just use whatever you're most comfortable with. But the default auto complete / auto import / auto getter/setter /etc stuff that's built in to Eclipse is really handy. | ||
wherebugsgo
Japan10647 Posts
On September 06 2012 13:16 phar wrote: Eclipse is a huge timesaver for Java. If you're not going to be writing that much code it won't matter, but if you have to crank out like 4k loc a week, Eclipse helps with the RSI :\ If this is for ar Uni class, just use whatever you're most comfortable with. But the default auto complete / auto import / auto getter/setter /etc stuff that's built in to Eclipse is really handy. yeah so it's for a university class (UC Berkeley) and our "official" text editor is emacs. We have been told that we can use Eclipse if we want to, but our prof made a list of things he hates about Eclipse and most of us learned on vim/emacs anyway so it's not a huge deal. | ||
| ||