SgtMe 46 Veteran Poster Featured Poster

We can help you if you make a start on the code to show your commited to your project :)
I would recommend that you look into using a program called PyGame. Start of making some basic programs such as how to open a window with PyGame and then how to draw a rectangle. Then you can use PyGame to detect the mouse position and pass it to the functions. PyGame has some excellent documentation pages:
http://pygame.org/docs/

SgtMe 46 Veteran Poster Featured Poster

Please mark the thread as solved then :)

SgtMe 46 Veteran Poster Featured Poster

:D Please upvote my post then and mark the thread as solved. Thanks :)

SgtMe 46 Veteran Poster Featured Poster

Ouch. That sounds quite hard. To the best of my knowledge, there isn't any way of combining another GUI kit with Allegro. Your best option would be to make your own text entry field. Draw out a box, and when the user clicks on it (check mouse position), a flashing bar comes up (you could leave that out). As the user types, it goes to a string which is drawn on screen (you would have a string of the input, which gets one letter appended to it at a time).
That's just an example :)

SgtMe 46 Veteran Poster Featured Poster

Still, the logic can be applied in C++.

SgtMe 46 Veteran Poster Featured Poster

You mean DarkGDK?
What problems are you having Translucentbill?
When you download new packages, and you choose allegro, there are a few versions.
For me, 4.4.0.1 didn't work (invalid package file), so I got like 4.2.1 or something :)

SgtMe 46 Veteran Poster Featured Poster

I would start using allegro. It's quite easy and you can simply download and install the package in Dev-C++.
http://www.cppgameprogramming.com/cgi/nav.cgi?page=index

SgtMe 46 Veteran Poster Featured Poster

In your code, you specify numbers of length "9" (index "0" to index "8"). Then, you have a look that feeds data into the array "if nSize is less than or equal to length '10' (index '0' to index '9')". Therefore, your program will try to reference an index of the array that doesn't exist. This is what it should be something like (this is for 10 array values).

int const nSize = 10;
double numbers[nsize];

for (i=0; i<nSize; i++){
//do loop here
}
SgtMe 46 Veteran Poster Featured Poster

It means that you can put a sim-card from any network into the phone. For example, if you buy a phone from orange, you can only put an orange sim in it. If you buy a sim-unlocked phone, you could put in an orange sim, vodafone sim, 3 sim etc.

NewOrder commented: thanks +0
SgtMe 46 Veteran Poster Featured Poster

If you go on the android developer site (http://developer.android.com/index.html), you can see some development devices. The "Nexus One" is listed, as well as the "ADP 2", though to use these for development, you have to buy them sim-unlocked from android or somewhere. Have a look round the site and see what you can find.

SgtMe 46 Veteran Poster Featured Poster

Do you mean program WITH the phone, or program FOR the phone?
Not sure about programming with it. Seeing as it is an android device, there may be an android app for this, but you would haev to do some research. If you mean programming FOR, then of course you can! Do a quick google and see what you can turn out.
Good luck :)

SgtMe 46 Veteran Poster Featured Poster

I would use Python 2.7, simply because there are so many more tutorials and examples on the internet. Python 3x isn't yet supported by many useful libraries, so Python 2.7 is the way to go at the moment. One day there will be a big shift where the majority jumps across to 3x, but at the moment, just stick to version 2.
(Please upvote my helpful posts :) )
EDIT: Thanks for the upvote :)

SgtMe 46 Veteran Poster Featured Poster

http://www.youtube.com/user/TheMonkeyLords#p/c/0/RC5GeZIOZaU
This is a guy who has a series of Python 3 tutorials. If the link works, you should see the playlist of the videos on the right. If not, you will need to find the "Python 3 Tutorials" playlist.
Good luck :)

FAITH2011 commented: Kind Reply +1
SgtMe 46 Veteran Poster Featured Poster

Nah it's cool :)
So is your problem fixed or do you have another problem or the same problem or what?

SgtMe 46 Veteran Poster Featured Poster

Wow! That's a lot of code!
The best thing to do, before we read through your code, is for you to use "cout" statements to work out where the lions are disappearing. Look at the last console line when a lion disappears at the wrong time, and then you can work out where the line is, or where abouts it is.

SgtMe 46 Veteran Poster Featured Poster

Don't worry it's cool :) The point is that you now know :)

SgtMe 46 Veteran Poster Featured Poster

Please repost your code with code tags (push the code button before you paste your code).

SgtMe 46 Veteran Poster Featured Poster

There won't be a straight forward method of converting every piece of Raptor code into Python code. The way to do it is to look at each line and find functions and methods that make the equivalent of the Raptor code. Effectively, you are rewriting your program around the same logic.

SgtMe 46 Veteran Poster Featured Poster

Next time, please press the code button before you paste your code.

for (i=0; i<=9; i++){}

Ever done a while loop before? Consider a loop which is while (i<=9){} . At the end of the loop, you would have i++; to increment the value of i .
Basically (in a for loop): i=0 makes a new variable called i which is set to 0 . i<=9 means that we keep looping while i is less than or equal to 9. i++ means that we increment the value of i once each loop.

SgtMe 46 Veteran Poster Featured Poster

Say you have the number: 251 The smallest number from those digits will be: 125 Therefore: digit1 = smallest number, digit2 = next smallest, etc.

Seperate the number into individual digits using an array. Find the smallest value and put this in the first index of a new array. Repeat this, removing the number you use each time, until you have no numbers left in the original array. Put all of the new array's values into a string and convert that to an int. This is your new number!

EDIT: You may want to use lists not an array.
EDIT EDIT: Oops got beaten too it. Ah well :)

SgtMe 46 Veteran Poster Featured Poster

No please upload it. We really need to see it! Just think: we could fix any errors in that file, help you shorten it, help you improve your knowledge etc. :)

SgtMe 46 Veteran Poster Featured Poster

OK :) Steps:

1. The download in step 2 (the files for wxPython) are in a "tarball (tar.gz2)". Not sure what you use on Ubuntu to open these. Have a look around and you should find something. Try this link though (look at the first post by MisfitI38) http://ohioloco.ubuntuforums.org/showthread.php?t=1417011
You may need to extract twice. On windows 7 with 7-zip, you extract the "tar.gz2" to a ".tar", then to the folder containing the files.

2. Download the source package for wxPython here:
http://sourceforge.net/projects/wxpython/files/wxPython/2.8.11.0/wxPython-src-2.8.11.0.tar.bz2/download

3. Extract the tarball to wherever. It doesn't really matter.

4. Look for the folder wxPython-src-2.8.11.0\wxPython\ . In this folder, there should be a script called "setup.py". Copy the path to this file, including the filename (if you can't copy this, tac it on in the next step).

5. Open the shell or whatever (like Windows Command Prompt). Not sure what the Ubuntu command is, but ( cd ) navigate to the directory of your file (paste it in). The tarball must be fully extracted.

6. Type: setup.py install or failing that, python setup.py install . NOTE: THESE ARE THE WINDOWS COMMANDS. YOU MAY HAVE TO PUT SOMETHING FUNNY IN THOSE, BUT TRY THEM OUT FIRST!!!

7. The console will stream out a whole load of cr*p. Ignore this. It should give you confirmation or whatever. Don't close the shell just yet! Open up your python prompt and type import wx . If …

SgtMe 46 Veteran Poster Featured Poster

Try downloading the source package of wxPython.
Then run setup.py install from the command line.

SgtMe 46 Veteran Poster Featured Poster

Yup :) Well...if not then host it externally at like http://www.mediafire.com or somewhere.

SgtMe 46 Veteran Poster Featured Poster

I think allegro is a good place to start. It's fairly primitive, but it should be advanced enough to make some good little 2D games, as long as you know what your doing with it. Not sure what you mean about PyGame not being documented very well. There are loads of examples and a full documentation of all the functions. I got along fine with it, and I'm now using PyOpenGL with it as well.

SgtMe 46 Veteran Poster Featured Poster

This works for me:

import random
import os

def main ():

    #declare variables
    compNumber = 0
    playNumber = 0
    tie = 0

    playGame = findWinner(compNumber, playNumber, tie)
    os.system("pause")



def findWinner(compNumber, playNumber, tie):

    compNumber = random.randint(1, 3)
    print "Player1, please select your choice."
    playNumber = int(raw_input('1 for Rock, 2 for Paper, or 3 for Scissors: '))
    print "The computer chose: ", compNumber

    if compNumber == 1 and playNumber == 3:
            print "Computer wins - Rock smashes scissors!"
            tie = 0
    elif compNumber == 1 and playNumber == 2:
            print "Player1 wins - Paper covers rock!"
            tie = 0
    elif compNumber == 2 and playNumber == 1:
            print "Computer wins - Paper covers rock!"
            tie = 0
    elif compNumber == 2 and playNumber == 3:
            print "Player1 wins - Scissors cut paper!"
            tie = 0
    elif compNumber == 3 and playNumber == 1:
            print "Player1 wins - Rock smashes scissors!"
            tie = 0
    elif compNumber == 3 and playNumber == 2:
            print "Computer wins - Scissors cut paper!"
            tie = 0
    elif compNumber == playNumber:
            print "TIE - You must keep playing for a winner!"
            tie = 1
    
    return tie

#calls main
main()

I think I changed something else, but the main thing I noticed is line 20 in my above code. I added int() around the raw_input() to make sure that it converted to int. That was probably it.

SgtMe 46 Veteran Poster Featured Poster

LOL that's not long! You only need to upload it if it's like, oh I don't know, let's say...200+ lines. Generally people won't read a longer code like that.
I need you to upload "functions.txt" 'cos your code uses that and I have no idea what it looks like/does.

SgtMe 46 Veteran Poster Featured Poster

You won't. How many lines is it? If it's more than about 350 then you would want to upload and attach it. Definitely attach if it's in more than two or three files. If not, then consider splitting it into more files so you don't end up with one long piece of code.

SgtMe 46 Veteran Poster Featured Poster

Well post the code. We can't help without it!
Well people lie about things not being school assignments ;)
Anyway, I wouldn't help someone who didn't show effort regardless.

SgtMe 46 Veteran Poster Featured Poster

We won't write the code for you. We will help you if you show us effort. Sorry, but it's the rules.

SgtMe 46 Veteran Poster Featured Poster

For a start, on line 9 you call:

drawPatchwork(height, width, Colours)

You don't have a function called "drawPatchwork"

In line 45, you pass a value to variable "y" in the variables. However, you then instantly overwrite it in the next line to value "51".

Line 52 can be

radius-=5

Line 53 can be

y+=5
SgtMe 46 Veteran Poster Featured Poster

Please use code tags next time (push the CODE button before you paste your code).

SgtMe 46 Veteran Poster Featured Poster

Please use code tags (push the code button before you paste the code). What problem are you currently having?

SgtMe 46 Veteran Poster Featured Poster

Try the "allegro" library. Do a search on YouTube for how to set it up with VC++. There is a good set of tutorials and some example (the examples are all games-based) at:
http://www.cppgameprogramming.com/cgi/nav.cgi?page=allegbasics

Just double click anywhere on the site to bring up the menu :)

SgtMe 46 Veteran Poster Featured Poster

What is the error? Is it a compiler error? Runtime error? Logic error?

SgtMe 46 Veteran Poster Featured Poster

Couldn't you use a switch instead of having all of those if statements? I'm sure they will be an even better method than that. Do you actually need the lower case bit? Or could 'z' and 'Z' be the same? If so, then you just need one line to capitalize it before you check which letter it is. Check this out:
http://www.daniweb.com/forums/thread100207.html

SgtMe 46 Veteran Poster Featured Poster

We won't write your code for you. It's your homework, not ours. Show us some of your code and we can help you if you have problems. But don't think that we will do your hard work. These tasks are designed for you to learn. You won't learn anything if we give you the code.

SgtMe 46 Veteran Poster Featured Poster

A quick google turned this out (I just added ' system("pause"); ') :

#include <fstream>
#include <iostream>
using namespace std;

int main () 
{
  char buffer[256];
  ifstream myfile ("test.txt");

  while (! myfile.eof() )
  {
	myfile.getline (buffer,100);
	cout << buffer << endl;
  }
  system("pause");
  return 0;
}

Seemed to work for me :)

SgtMe 46 Veteran Poster Featured Poster

In your code, you have a kind of double negative here:

while not n == 0:

This is saying that "while 'n' does not equal 0", do stuff.
A simpler way of writing this is "while n != 0:".
The "not" is only really used for boolean. ie:

a = True
while not a:
	print ':)'

the "not" effectively means "false". So: "while 'a' is false".

In your code, you have a kind of double negative here:

while not n == 0:

This is saying that "while 'n' does not equal 0", do stuff.
A simpler way of writing this is "while n != 0:".
The "not" is only really used for boolean. ie:

It looks rather like you are going to use the first bit :)

Just a note: a more convential way of doing this starts at zero and counts to 'n', not the other way round. It won't make any difference, it's just a convention.

Line 3 could also be:

n -= 1
SgtMe 46 Veteran Poster Featured Poster

When you have the "return" statements, ie.

{return title;}
//and
{return price;}

You shouldn't have braces. It should be:

return title;
return price;
SgtMe 46 Veteran Poster Featured Poster

I see what you did with the word "bone" -_-

:L

SgtMe 46 Veteran Poster Featured Poster
SgtMe 46 Veteran Poster Featured Poster

If the last letter is b or d or g etc., then add "word[wordlength]" on the end, nad then add 'er'. Just use a compound if statement to test for all the letters.

SgtMe 46 Veteran Poster Featured Poster

Sorry "woooee" but I'm taking his side. I never ever ever ever ever give out free homework help. However, I will give links to sites and tiny snippets of code to get them started. "M3M69" is relatively new here, so go easy on them :)

SgtMe 46 Veteran Poster Featured Poster

Well have a look, make a few demo programs to get the feel, then incorporate them into your main program.

SgtMe 46 Veteran Poster Featured Poster

Found this page. Not sure if it's helpful or not.
http://www.daniweb.com/forums/thread96561.html

SgtMe 46 Veteran Poster Featured Poster
SgtMe 46 Veteran Poster Featured Poster

What problem are you currently having?

SgtMe 46 Veteran Poster Featured Poster

Have you tried enclosing the whole thing (after the equals) in "float(...);"? Sometimes that works...

SgtMe 46 Veteran Poster Featured Poster

If we break down the logic in that line, it is correct.

sqrt(
pow(mypointx-pointpx, 2)
+
pow(mypoint-pointpy, 2)
)
;

Have a look on google and see if you can find anything on converting scientific to decimal.