Forum: C++ May 29th, 2009 |
| Replies: 10 Views: 812 I think Ancient Dragon was suggesting that you learn win32 for PC first because it will be easier to learn since it's easier to debug and there are more tutorials available for it. Once you have... |
Forum: C++ May 29th, 2009 |
| Replies: 4 Views: 403 Are you interested in writing programs for your pocket pc in c++, or are you trying to run compiled programs on the device? |
Forum: C++ May 24th, 2009 |
| Replies: 3 Views: 577 Leopold, the issue you're having with "too few arguments" is occuring because you are calling functions with zero inputs that require three inputs.
You call the function radius like this:... |
Forum: Community Introductions Sep 3rd, 2008 |
| Replies: 2 Views: 335 Welcome. Hope you can get the help you need here at DaniWeb. |
Forum: PHP Jun 25th, 2008 |
| Replies: 2 Views: 478 To add images, you just use HTML:
<img src="SOURCE OF IMAGE" alt="TEXT IF IMAGE DOESN'T SHOW"/>
Is that your only problem? I can't quite understand what you are asking for. |
Forum: Game Development Dec 5th, 2007 |
| Replies: 8 Views: 2,458 Thank you. That's exactly what I'm looking for. I'll keep looking into it, but would it be possible for you to explain how exactly I could implement this? It seems that the decorator classes would be... |
Forum: Game Development Dec 5th, 2007 |
| Replies: 8 Views: 2,458 Hmmm.. that sure seems complicated.
So, have you ever played WoW, Runescape, MapleStory or an RPG similar to those? In those games, there are many skills that you can have. You can only use them... |
Forum: Game Development Dec 4th, 2007 |
| Replies: 8 Views: 2,458 Hello,
I worked with Python for about a year. Then I moved on to C/C++. Now I'm learning Java. I know the basics of programming really well, and I'm starting to get a good grasp of OOP.
I'm... |
Forum: C++ Nov 14th, 2007 |
| Replies: 11 Views: 2,151 If userInput is an int, it's never going to be an empty string. |
Forum: C++ Nov 5th, 2007 |
| Replies: 6 Views: 1,779 Read this for more info on rand():
http://www.cplusplus.com/reference/clibrary/cstdlib/rand.html
More info on srand():
http://www.cplusplus.com/reference/clibrary/cstdlib/srand.html
You need... |
Forum: C++ Nov 5th, 2007 |
| Replies: 1 Views: 634 This is where you input -1 in the second time:
cin.good() evaluates to true and the while loop exits.
Wouldn't it be better to do something like this?
(psuedo code) |
Forum: Java Oct 25th, 2007 |
| Replies: 2 Views: 786 Yeah, just change the numbers in the if statements.
Fyi, you don't need the first boolean comparison in the if statements.
Example:
if (numGrade > 3.7)
grade = "A+";
else if (numGrade... |
Forum: Posting Games Feb 12th, 2007 |
| Replies: 3,341 Views: 178,963 |
Forum: Python Feb 11th, 2007 |
| Replies: 16 Views: 2,989 Cool. It was fun to help. I'd love to see the finished products. When you finish them, post in a new post because it won't be about "scanning a string?" ...
Later. |
Forum: Python Feb 11th, 2007 |
| Replies: 16 Views: 2,989 Several syntax problems:
- You have "for triplet in range(0,1,3):" but later reference "triple", which is not a variable
- You create output as an empty string, and then never reference it.... |
Forum: Python Feb 11th, 2007 |
| Replies: 16 Views: 2,989 Oh. I was unaware of that. I'll have to rework the loop. Gimme a minute.
edit:
x += 1 is equivalent to x = x + 1. It's a shorter method of incrementing the variable.
!= means "does not equal."... |
Forum: Python Feb 11th, 2007 |
| Replies: 16 Views: 2,989 Okay.
Code:
d = {'a':'a','g':'c','c':'b'} # key is actually talking about a triple 'aaa':'a'
while True:
stuff = raw_input("string: ").lower()
if stuff == "exit": |
Forum: Python Feb 10th, 2007 |
| Replies: 4 Views: 4,318 Well... it seems to be using the older command prompt--the one that doesn't accept spaces.
If you know much about DOS, you might have seen this before:
C:\Progra~1\
Try that.
This seemed... |
Forum: Python Feb 10th, 2007 |
| Replies: 16 Views: 2,989 Yeah, ouch. That's a lot less efficient. Look up dictionaries. ;)
Do you need me to explain mine, or do you understand? |
Forum: Python Feb 10th, 2007 |
| Replies: 4 Views: 4,318 So you only got an error with execv? It looks like you need arguments with that. What's wrong with using os.system()?
My ie7 is in "c:/windows/ie7/"
This works on my computer:
import os... |
Forum: Python Feb 10th, 2007 |
| Replies: 16 Views: 2,989 Would you mind posting your code so we can see how you did it and change it from there?
Here's a little program I made to do the same thing:
d = {'a':'a','g':'c','c':'b'} # key is actually... |
Forum: Python Feb 7th, 2007 |
| Replies: 8 Views: 1,854 You need two underscores on both sides of the "init" method of your Point class.
#classify "Point"
class Point(object):
def __init__(self, x, y):
self.x = x
self.y = y
... |
Forum: Python Feb 3rd, 2007 |
| Replies: 7 Views: 1,991 Oh, excellent. Thank you.
I ran across this one method where you have a list of divisors and you remove all of the multiples as you go through. For example, say you're doing 1-100. It adds '2' as... |
Forum: Python Feb 3rd, 2007 |
| Replies: 7 Views: 1,991 I know printing primes isn't anything new, but (like always) I'd love to hear some feedback on how I can make my code more efficient and other constructive criticism.
def print_primes(r=10):
... |
Forum: Python Jan 28th, 2007 |
| Replies: 2 Views: 2,235 RPG = Role Playing Game... right now I'm implementing locked doors to open and a "look" command to look at things. |
Forum: Python Jan 22nd, 2007 |
| Replies: 2 Views: 2,235 Zonr and I have been working on a fun text game containing different rooms, monsters (with a D&D-esque battle system), and save/load functions.
Here are the files. You need to have all of them... |
Forum: Python Dec 13th, 2006 |
| Replies: 6 Views: 5,854 So, I created this fun little Tic Tac Toe game all on my own. It was a tough project, and I know I used some inefficient strategies in the coding. Just like the other things I've posted, this could... |
Forum: Python Dec 10th, 2006 |
| Replies: 5 Views: 2,065 Well.. if you wrote your own classes like Tkinter, I guess you could. Why would you? |
Forum: Python Dec 8th, 2006 |
| Replies: 8 Views: 2,893 This works:
http://en.wikipedia.org/wiki/Unununium_(operating_system) |
Forum: Python Dec 8th, 2006 |
| Replies: 5 Views: 2,065 Here's a good example of startswith:
# Declare some values (strings...)
codes = ["00123","00332","40325","00455"]
# Print out an error message if a code doesn't have the right prefix: "00"... |
Forum: Python Dec 5th, 2006 |
| Replies: 19 Views: 6,135 Wow, ghostdog. That's short code. Talk about clean. I can understand that... the list comprehensiong stuff, but I have yet to implement it into something of my own. I don't think about using it when... |
Forum: Python Dec 5th, 2006 |
| Replies: 2 Views: 2,055 That seems like the obvious solution. |
Forum: Python Dec 5th, 2006 |
| Replies: 19 Views: 6,135 I tried it out myself and came up with the following code. It adds to a new string created in the functions to create the encoded or decoded text.
def encode(text):
encoded = ""
for... |
Forum: Python Dec 1st, 2006 |
| Replies: 8 Views: 1,789 Seeeing if I could just get it to pick up all the coins without errors, I wrote some working code EXCEPT that it had no random thing, so if in its path going back and forth it saw no coins, it got... |
Forum: Python Nov 23rd, 2006 |
| Replies: 3 Views: 1,381 I would suggest creating the box in one string or several strings and then print that string. |
Forum: Python Nov 9th, 2006 |
| Replies: 12 Views: 2,555 That looks interesting! Would you mind posting your entire tic-tac-toe program? |
Forum: Python Nov 8th, 2006 |
| Replies: 9 Views: 4,522 Mawe, could you explain this piece by piece?
In [1]: import re
In [2]: pattern = re.compile("(\d)([A-Za-z])")
In [3]: formula = "6x+3x^2"
In [4]: re.sub(pattern, r"\1*\2", formula)
Out[4]:... |
Forum: Python Nov 7th, 2006 |
| Replies: 9 Views: 4,522 Wow. Thanks a LOT for your input. I wasn't aware of eval()'s function before this. Also, I looked into regex. Thanks. Yeah, trig functions will be used. |
Forum: Python Nov 7th, 2006 |
| Replies: 14 Views: 3,812 I couldn't get it to work and then realizeed that you need python 2.4; 2.5 doesn't work. oh well... |
Forum: Python Nov 7th, 2006 |
| Replies: 9 Views: 4,522 Yes.
I realized that.
I'm pretty new to complicated problems like this problem. I've mostyl been doing basic stuff. This sounded like a fun thing to do. My friend in Calculus asked me... |