New OOTS products from CafePress
New OOTS t-shirts, ornaments, mugs, bags, and more
Page 7 of 12 FirstFirst 123456789101112 LastLast
Results 181 to 210 of 356

Thread: ProgrammersitP

  1. - Top - End - #181
    Ogre in the Playground
    Join Date
    Mar 2010
    Location
    Gridania, Eorzea
    Gender
    Male

    Default Re: ProgrammersitP

    Quote Originally Posted by The Succubus View Post
    I'd like to learn to use Linux au naturalle, as it were. To learn how it works on a real hard drive, with real PC components, to learn how to do Linux driver troubleshooting, and maybe even learn how to compile kernals and do custom setups.

    The reason I want to do it on a second disk is because if it all goes fruit-shaped as it inevitably will, the SSD with Windows on will be unscathed and fine. Besides, partitioning hard disks is a bitch, I've found. -.-

    I'll be using Linux from time to time, rather than constantly because although a fair percentage of the games I play work in Linux, not all of them do sadly, so I still need a fully working Windows PC for most of the time. However, I'll be looking to do as much as I can in Linux though. =)
    If you haven't found it, or had it suggested yet, definitely check out wine for getting games to run in Linux. Some games take a lot of effort with all the extra bits you have to do to get them to run properly, but for the most part it greatly increases the number of games you can get to run in Linux without too much hassle.

    As for python, I find it to be a very fun language to use, and very straight forward. I'm still learning it myself, but compared to what I do know (C++ and some C) it seems less messy, at least syntacticly. For instance:

    Spoiler
    Show
    Python:

    print "Hello world!"

    C:

    #include<stdio.h>

    int main(void)
    {
    printf("Hello World!");
    }


    It does get a bit interesting when you try to turn python files into .exe but there's oodles of online resources for python. Also depending on what you want to do with python, I know a number of good tutorial sites if you're interested (everything from an in browser compiler to how to program a rougelike).
    Quote Originally Posted by Rockphed View Post
    Dwarf Fortress would like to have a word with you. The word is decorated with bands of microcline and meanaces with spikes of rose gold. On the word is an image of the word in cinnabar.
    Quote Originally Posted by kpenguin View Post
    This is an image of Wookietank the Destroyer of Fortresses engraved in sandstone. Wookietank the Destroyer of Fortresses is leaving Trotknives. Trotknives is on fire and full of goblins. This image refers to the destruction of Trotknives in late winter of 109 by Wookietank the Destroyer of Fortresses.

  2. - Top - End - #182
    Ettin in the Playground
     
    The Succubus's Avatar

    Join Date
    Sep 2008
    Location
    UK
    Gender
    Male

    Default Re: ProgrammersitP

    Oooo, yes please! I'd love some links like that! If you know any good Python books as well, I have a book token in urgent need of using. =3

    I also understand there's a Linux version of Dungeons of Dredmor too....;)

  3. - Top - End - #183
    Bugbear in the Playground
     
    Leolo's Avatar

    Join Date
    Nov 2009
    Location
    Germany
    Gender
    Male

    Default Re: ProgrammersitP

    Quote Originally Posted by akma View Post
    I have a problam with regular expressions in Java.
    The program gets a string representing a mathmatical formula (a+b-3, for exemple), then you put values for the variables (possible 2 for a and 4 for b), and a method in the class returns the result (in this exemple, 3). I had a version that crashed in certain conditions due to bad design, so I commented out everything and started again.

    After doing some modifications to the formula (converting from ab to a*b), I try to isolate the oparaters using String.split("[a-zA-Z0-9]"). This returns a String array, which always contains empty strings. I can bypass that, but I rather know why I get empty strings, and how to avoid it in the future.
    You mean like this?

    Code:
    	    String test="a*b-c/d";
    	    String[] split = test.split("[a-zA-Z0-9]");
    	    int ctr=0;
    	    for(String s:split){
    	    	System.out.println("operator "+(++ctr)+": "+s);
    	    }
    The reason why (the first) element of the array is empty is that you have set all letters and numbers as split argument. It is as if you would split a comma seperated text into an array that starts with a comma. So ";a;b;c".split(";") results in [],[a],[b],[c]

    Same is true if your variables are more than one char long. So "way/time=speed".split("[a-zA-Z0-9]"); would result in

    operator 1:
    operator 2:
    operator 3:
    operator 4: /
    operator 5:
    operator 6:
    operator 7:
    operator 8: =

    A better way to do this would to first split the text into blocks of brackets recursive until no brackets exist. So

    "(1+a)*(10/(-b+2))" would become ["1+a",["10/","-b+2"]]

    When you have found an text without brackets split this into blocks of plus or minus (recursive, until no plus or minus exists) and replace every empty element with 0.

    So you now got:
    [["1","a"],[["10/"],["0","b","2"]]]

    now you replace all variables (for example with 2 and 3) and use the operators of the deepest level (that's because you should do this recursivly) so 0-3+2= -1

    You replace this level and get:
    [["1","a"],["10/","-1"]]

    Now you calculate those next levels. So 10/-1 is minus 10 and 1+2 is 3.

    You get ["3","-10"] and calculate this with the operator "*". The solution is -30.
    Last edited by Leolo; 2013-01-10 at 10:49 AM.

  4. - Top - End - #184
    Titan in the Playground
    Join Date
    Mar 2009
    Location
    Sweden
    Gender
    Male

    Default Re: ProgrammersitP

    Quote Originally Posted by Wookieetank View Post
    As for python, I find it to be a very fun language to use, and very straight forward. I'm still learning it myself, but compared to what I do know (C++ and some C) it seems less messy, at least syntacticly. For instance:

    Spoiler
    Show
    Python:

    print "Hello world!"

    C:

    #include<stdio.h>

    int main(void)
    {
    printf("Hello World!");
    }
    Given, both #include and main are lines that'll take up less than a percent of any larger project, and the added parantheses are just as much of a hassle as the indentation rules for Python, i.e. no a lot.

    Also, unlike C, Python was developed as a scripting language, and sacrifices large scale performance for lower developement times.
    Clouddreamer Teddy by me, high above the world, far beyond its matters...

    Spoiler: Banner by Vrythas
    Show

  5. - Top - End - #185
    Ogre in the Playground
    Join Date
    Mar 2010
    Location
    Gridania, Eorzea
    Gender
    Male

    Default Re: ProgrammersitP

    Quote Originally Posted by The Succubus View Post
    Oooo, yes please! I'd love some links like that! If you know any good Python books as well, I have a book token in urgent need of using. =3

    I also understand there's a Linux version of Dungeons of Dredmor too....;)
    In Browser Tutorial

    How to make a Roguelike (WARNING: site also contains a rather comprehensive list of all roguelikes)

    Two books on making games with python and pygame

    Pygame homepage (also has links to how tos)

    The obligatory everything python

    As for actual books, I'm not sure of what to get. Once I can get to my jump drive though I do have a number of ebooks that might be useful, I'll post the names once I find them.
    Last edited by Wookieetank; 2013-01-10 at 10:53 AM.
    Quote Originally Posted by Rockphed View Post
    Dwarf Fortress would like to have a word with you. The word is decorated with bands of microcline and meanaces with spikes of rose gold. On the word is an image of the word in cinnabar.
    Quote Originally Posted by kpenguin View Post
    This is an image of Wookietank the Destroyer of Fortresses engraved in sandstone. Wookietank the Destroyer of Fortresses is leaving Trotknives. Trotknives is on fire and full of goblins. This image refers to the destruction of Trotknives in late winter of 109 by Wookietank the Destroyer of Fortresses.

  6. - Top - End - #186
    Troll in the Playground
    Join Date
    Jan 2012

    Default Re: ProgrammersitP

    How about these for starters? *

    Think Python
    The Python Game Book

    *Full disclosure: I don't actually know Python. I'm merely regurgitating suggestions made in another thread; I think Rawhide suggested one of them too.

  7. - Top - End - #187
    Ogre in the Playground
    Join Date
    Nov 2006

    Default Re: ProgrammersitP

    Quote Originally Posted by The Succubus View Post
    Back again,

    With a little luck, I should have my Linux Mint OS set up on my second hard drive this weekend and I was advised by someone that learning Python could be beneficial when messing around in Linux.

    Do any of you know much about Python as a language? Is it fairly simple to understand and use? How does one go about compiling it, etc?

    It's been years since I last did coding - it'll be fun to put my programming hat back on again, even briefly. =)
    If you're looking to do Linux programming, you should consider looking at C/C++ as well. Most of the Linux kernel is written in C, though I hear the ancient Linux Wizards (Torvalds and the like) wrote in straight Assembly...

    As a language, I love Python. It's excellent for its simplicity, both to pick up and use. Python is an interpreted language (so, everything evaluated in sequence at runtime), and Python is frequently called a scripting language. Some more complex packages will automagically compile your Python files (*.py) into bytecode files (*.pyc), which are wholly unintelligible to your text editor, but run much faster.

    Quote Originally Posted by Teddy View Post
    I know practically nothing, but thankfully, it's a very simple language if you know any other object-oriented (or at least imperative) programming languages, so with some help from the API, I can hack together simple scripts without too much hassle anyway. The only real quirk as I see it is its somewhat off-standard indentation rules.

    I'm not sure about compiling, my experiments tells me Python uses an interpretter rather than a compiler. Either way, to start programming, install Python on your computer, open a plain text document (.txt), write your program and save it as a .py file. Then you can run it from the command line by writing "python filename.py" (you may have some problems with finding either Python or the file, in which case I suggest calling the command from Python's directory and using the full file path rather than just the filename).
    Quote Originally Posted by Teddy View Post
    Given, both #include and main are lines that'll take up less than a percent of any larger project, and the added parantheses are just as much of a hassle as the indentation rules for Python, i.e. no a lot.

    Also, unlike C, Python was developed as a scripting language, and sacrifices large scale performance for lower developement times.
    Someone keeps telling me there's a library out there that can (re)compile Python code that executes faster than a C program equivalent. PyPy I think? I haven't personally tried it, but compilation does exist... in a way (outside of compiling to Bytecode, similar to Java).

    Since this is Linux, Python should be installed by default into /usr/bin/pythonXY or something along those lines, and should be accessible on the default environment variables path (e.g. type "python" in your shell and a python interpreter should appear). If for some reason it isn't, you'll have to go looking for it ('which python') and then add it to your environment variables.

    Quote Originally Posted by factotum View Post
    If you definitely want to look at Python then I'm sure there are Windows interpreters available for it. Isn't PHP the usual language used, though? Pretty sure that's what the P in LAMP (Linux, Apache, MySQL, PHP) is...

    Also, why are you putting Linux on a second drive? That has the disadvantage you have to reboot your machine to use it. If all you're doing is looking at Linux programming then it would be more efficient to install something like VirtualBox and create yourself a Linux virtual machine; you could run such a thing at the same time as your Windows installation. You'd need a bit more RAM to do this, but Linux doesn't require that much so a spare gig would be enough for most things. (You can also use the WUBI version of Ubuntu if you want to run Linux under Windows--works quite well).

    Of course, if there are specific reasons why all this has to be the way you've described, ignore me...
    P on the LAMP stack is typically PHP, yes (or Perl). I don't think The Succubus explicitly mentioned web servers though (correct me if I'm wrong).

    The most common Python install is probably CPython (obviously built on C), though other versions exist.

    Quote Originally Posted by Teddy View Post
    Are you thinking of IDE interpretters? Because, as I said, Python itself is an interpretter, but it lacks an IDE in and on itself.
    Python ships with the IDLE editor, though I wouldn't go so far as to say it's an IDE.

    Sublime Text is an excellent editor, and is cross platform. Or you could join the raging debate between Vim and Emacs users...



    1


    Succubus, what sort of Python programming are you looking to do exactly?

  8. - Top - End - #188
    Ogre in the Playground
    Join Date
    Mar 2010
    Location
    Gridania, Eorzea
    Gender
    Male

    Default Re: ProgrammersitP

    Quote Originally Posted by Neftren View Post
    Sublime Text is an excellent editor, and is cross platform. Or you could join the raging debate between Vim and Emacs users...


    [
    Or you could use notepad++ and have no idea what the difference between VIm and Emacs even is. Although i hear I should look into both depending on who I ask.
    Quote Originally Posted by Rockphed View Post
    Dwarf Fortress would like to have a word with you. The word is decorated with bands of microcline and meanaces with spikes of rose gold. On the word is an image of the word in cinnabar.
    Quote Originally Posted by kpenguin View Post
    This is an image of Wookietank the Destroyer of Fortresses engraved in sandstone. Wookietank the Destroyer of Fortresses is leaving Trotknives. Trotknives is on fire and full of goblins. This image refers to the destruction of Trotknives in late winter of 109 by Wookietank the Destroyer of Fortresses.

  9. - Top - End - #189
    Ogre in the Playground
    Join Date
    Nov 2006

    Default Re: ProgrammersitP

    Quote Originally Posted by Wookieetank View Post
    Or you could use notepad++ and have no idea what the difference between VIm and Emacs even is. Although i hear I should look into both depending on who I ask.
    Notepad++ is Windows only (and as we're looking at Linux development...).

    Now, Notepad++ does run in WINE, but running it in WINE is one of the most frustrating experiences I have ever had with software running in WINE. Making a small edit to the file outside of Notepad++ while the file is still open in Notepad++? NOPE! Boom! It throws a fit, and either closes the file or kicks you to the desktop before crashing and burning in a horrible fit.

    And no, this had nothing to do with any other software on the machine or installation incompetence on my part (at least, I'd hope not), as it was a fresh out of the box OpenSUSE install, and the only thing I'd done up to that point was 'sudo zypper install wine' before downloading the Windows install binary. Something along those lines anyways... WINE might have been installed already. Anyways...


    Edit: as for the Vim vs. Emacs debate, it is necessary to link the relevant xkcd strip.

    You might also be interested in Wikipedia's article, and what the folks over at Stack Exchange have to say.
    Last edited by Neftren; 2013-01-10 at 12:46 PM.

  10. - Top - End - #190
    Ogre in the Playground
    Join Date
    Mar 2010
    Location
    Gridania, Eorzea
    Gender
    Male

    Default Re: ProgrammersitP

    Quote Originally Posted by Neftren View Post
    Notepad++ is Windows only (and as we're looking at Linux development...).

    Now, Notepad++ does run in WINE, but running it in WINE is one of the most frustrating experiences I have ever had with software running in WINE. Making a small edit to the file outside of Notepad++ while the file is still open in Notepad++? NOPE! Boom! It throws a fit, and either closes the file or kicks you to the desktop before crashing and burning in a horrible fit.

    And no, this had nothing to do with any other software on the machine or installation incompetence on my part (at least, I'd hope not), as it was a fresh out of the box OpenSUSE install, and the only thing I'd done up to that point was 'sudo zypper install wine' before downloading the Windows install binary. Something along those lines anyways... WINE might have been installed already. Anyways...


    Edit: as for the Vim vs. Emacs debate, it is necessary to link the relevant xkcd strip.

    You might also be interested in Wikipedia's article, and what the folks over at Stack Exchange have to say.
    Good to know. Although now I'm tempted to try notepad++ with ubuntu and see what it does/how awesomely I can mangle things up. Supposing I can pull myself away from my lappy (damnit steam quit having sales already! ><).
    Quote Originally Posted by Rockphed View Post
    Dwarf Fortress would like to have a word with you. The word is decorated with bands of microcline and meanaces with spikes of rose gold. On the word is an image of the word in cinnabar.
    Quote Originally Posted by kpenguin View Post
    This is an image of Wookietank the Destroyer of Fortresses engraved in sandstone. Wookietank the Destroyer of Fortresses is leaving Trotknives. Trotknives is on fire and full of goblins. This image refers to the destruction of Trotknives in late winter of 109 by Wookietank the Destroyer of Fortresses.

  11. - Top - End - #191
    Titan in the Playground
    Join Date
    Mar 2009
    Location
    Sweden
    Gender
    Male

    Default Re: ProgrammersitP

    Quote Originally Posted by Neftren View Post
    Someone keeps telling me there's a library out there that can (re)compile Python code that executes faster than a C program equivalent. PyPy I think? I haven't personally tried it, but compilation does exist... in a way (outside of compiling to Bytecode, similar to Java).
    Well, from what I've understood, Java programs may execute mariginally faster than their C equivalents, so it's not outside the realm of possibility for compiled Python as well...

    Quote Originally Posted by Neftren View Post
    Python ships with the IDLE editor, though I wouldn't go so far as to say it's an IDE.
    More like a plain text editor with some fancy colours and semi-automatic indentation.
    Clouddreamer Teddy by me, high above the world, far beyond its matters...

    Spoiler: Banner by Vrythas
    Show

  12. - Top - End - #192
    Ogre in the Playground
    Join Date
    Nov 2006

    Default Re: ProgrammersitP

    Quote Originally Posted by Teddy View Post
    Well, from what I've understood, Java programs may execute mariginally faster than their C equivalents, so it's not outside the realm of possibility for compiled Python as well...
    On closer examination, PyPy appears to be Python's bootstrapped interpreter (i.e. Python interpeter written in RPython).

    I'm not really going to go into the Java vs. C/C++ debate, other than to say this is an optimisation problem that could swing either way.
    Last edited by Neftren; 2013-01-10 at 02:15 PM.

  13. - Top - End - #193
    Colossus in the Playground
     
    BlackDragon

    Join Date
    Feb 2007
    Location
    Manchester, UK
    Gender
    Male

    Default Re: ProgrammersitP

    Quote Originally Posted by Neftren View Post
    Now, Notepad++ does run in WINE, but running it in WINE is one of the most frustrating experiences I have ever had with software running in WINE.
    Were you just attempting that for fun? WINE is usually used to run stuff that there simply isn't an equivalent of in Linux (e.g. games, as mentioned earlier), but last time I checked, there are approximately 873 million different text editors available in Linux...

  14. - Top - End - #194
    Ogre in the Playground
    Join Date
    Nov 2006

    Default Re: ProgrammersitP

    Quote Originally Posted by factotum View Post
    Were you just attempting that for fun? WINE is usually used to run stuff that there simply isn't an equivalent of in Linux (e.g. games, as mentioned earlier), but last time I checked, there are approximately 873 million different text editors available in Linux...
    In hindsight, I was kind of an idiot about the whole thing. I wasn't really satisfied with the stuff already on the machine, and I didn't really like the look and feel of a lot of existing editors. I spend most of my time working in OSX, where desktop applications have excellent look and feel--the same cannot be said of "Free Software" on Linux. Nothing I found could really compare to Xcode and Dashcode. Since those are unavailable in Linux, I turned to Notepad++ since it was the next most familiar thing, and it does run in WINE (albeit poorly, as I later discovered).

    Then I stumbled on Sublime Text and have never looked back. It really knocks the park out of literally every other editor or IDE I've used, with the exception of Xcode for C/C++ development (or developing C/C++ and Python in parallel), and Visual Studio for working on Microsoft stuff.
    Last edited by Neftren; 2013-01-10 at 10:24 PM.

  15. - Top - End - #195
    Ogre in the Playground
    Join Date
    Oct 2009

    Default Re: ProgrammersitP

    Quote Originally Posted by Neftren View Post
    Then I stumbled on Sublime Text and have never looked back. It really knocks the park out of literally every other editor or IDE I've used, with the exception of Xcode for C/C++ development (or developing C/C++ and Python in parallel), and Visual Studio for working on Microsoft stuff.
    I completely agree Sublime Text really is awesome!
    Though nothing beats intelliJ, its practically magic combined with chuck norris

  16. - Top - End - #196
    Barbarian in the Playground
     
    BarbarianGuy

    Join Date
    Feb 2010
    Location
    Calgary
    Gender
    Male

    Default Re: ProgrammersitP

    This new computer science course is going to drive me nuts I think. It has nothing to do with it being in java, or any of the logic, or anything like that. It has to do with getting help and citing sources. Now don't get me wrong, I have no problem with citing sources, but it seems to be going overboard.

    For example, our prof today should an example of code for reading a file. with a

    do
    {
    a bunch of stuff
    }
    while(filepointer != null)


    The thing is I have been programming on and off for over 25 years. A little for work, but mostly on my own. something like that is standard, yet if I do something like it in my code, if I don't say in the documentation

    *this code from prof joe blow from cpsc course on jan 22*

    i would get 0% and maybe kicked out of the course for cheating.

    On top of that if I am having problems and seek help I can't post/show/say any of my code to any one (except prof and TA) or again I risk getting kicked out for cheating because another student might see/hear my code.

  17. - Top - End - #197
    Ogre in the Playground
    Join Date
    Oct 2009

    Default Re: ProgrammersitP

    Quote Originally Posted by Balain View Post
    This new computer science course is going to drive me nuts I think. It has nothing to do with it being in java, or any of the logic, or anything like that. It has to do with getting help and citing sources. Now don't get me wrong, I have no problem with citing sources, but it seems to be going overboard.

    For example, our prof today should an example of code for reading a file. with a

    do
    {
    a bunch of stuff
    }
    while(filepointer != null)


    The thing is I have been programming on and off for over 25 years. A little for work, but mostly on my own. something like that is standard, yet if I do something like it in my code, if I don't say in the documentation

    *this code from prof joe blow from cpsc course on jan 22*

    i would get 0% and maybe kicked out of the course for cheating.

    On top of that if I am having problems and seek help I can't post/show/say any of my code to any one (except prof and TA) or again I risk getting kicked out for cheating because another student might see/hear my code.
    Thats seems extremely arbitrary (especially for simple stuff like a filereader) ^^
    Well I guess he doesn´t want you guys to copy paste most of your code (which can lead to working programs especially if they are not too complex)
    but wants you to really understand what you are doing, ie reading a sample code explaining how to solve problem xyz and then writing the thing.

    How he will ever be able to enforce it though is beyond me especially with nice little things like refactor rename
    Last edited by Emmerask; 2013-01-22 at 06:43 PM.

  18. - Top - End - #198
    Barbarian in the Playground
    Join Date
    Jul 2007
    Gender
    Male

    Default Re: ProgrammersitP

    Quote Originally Posted by Leolo View Post
    *help with old question I raised*
    Thank you.

    Quote Originally Posted by Teddy View Post
    Well, from what I've understood, Java programs may execute mariginally faster than their C equivalents, so it's not outside the realm of possibility for compiled Python as well...
    I don`t get why people are so obssesed with speed of execution. Even if C code is 3 times faster then Java, most things will still run faster then a blink of an eye. It would only matter in programs that realy take a lot from the computer. Besides, there are other factors to consider (Java is cross platform, for exemple).

    In another issue, I decided to start programming for Android, using Java. How relevent is Java ME to Android development? Any resources you can recommend to me? Any tips?
    Madly In Science, an RPG in which you play mad scientists, you can get it for free.

    Spoiler: Some other things.
    Show
    A world behind the mirror (stand alone plane)
    (Wall) passer, a rogue variant
    My not realy extanded homebrewer signature

    Quote Originally Posted by Grinner View Post
    In a world ruled by small birds, mankind cannot help but wonder how this state of affairs came about.

  19. - Top - End - #199
    Ogre in the Playground
    Join Date
    Oct 2009

    Default Re: ProgrammersitP

    Its a pretty simple step from java me to android
    though a few things differ greatly:

    1)ui library is more extensive and more complicated
    2)only one ui thread
    3)you have to be much more careful with threads and thread safety
    4)limited resources (due to deployment on a phone)
    5)no extensive database stuff, sqlite must suffice
    6)xml and json are pretty important ^^

    this video list might help you:

    http://www.youtube.com/view_play_lis...6D322B5E2764CF

    and of course there is:

    http://stackoverflow.com which is also the official help platform

    Another tip would be use Intellij instead of other ides it really makes life more easy

    http://www.jetbrains.com/idea/
    Last edited by Emmerask; 2013-01-23 at 06:25 AM.

  20. - Top - End - #200
    Ettin in the Playground
     
    The Succubus's Avatar

    Join Date
    Sep 2008
    Location
    UK
    Gender
    Male

    Default Re: ProgrammersitP

    How do folks like my avatar for Basic Avatar Week? Didn't really have enough space to do Visual Basic.

    As for what I'm looking to do in Python, probably a similar thing to shell scripting I guess. As mentioned above, I'm learning about Linux at the moment and it'd be cool if I could build a "toolkit" to do basic automated tasks with.

    Plus a language to write simple games in would be nice. I recall stuff like Laser Squad and Lords of Chaos from my CPC days and it'd be cool if I could write something like that.

  21. - Top - End - #201
    Barbarian in the Playground
    Join Date
    Jul 2007
    Gender
    Male

    Default Re: ProgrammersitP

    Quote Originally Posted by Emmerask View Post
    Its a pretty simple step from java me to android
    though a few things differ greatly:
    I actully have no background in Java ME, just Java SE (and thanks for the rest of the post). Would that be an issue?
    Madly In Science, an RPG in which you play mad scientists, you can get it for free.

    Spoiler: Some other things.
    Show
    A world behind the mirror (stand alone plane)
    (Wall) passer, a rogue variant
    My not realy extanded homebrewer signature

    Quote Originally Posted by Grinner View Post
    In a world ruled by small birds, mankind cannot help but wonder how this state of affairs came about.

  22. - Top - End - #202
    Colossus in the Playground
     
    BlackDragon

    Join Date
    Feb 2007
    Location
    Manchester, UK
    Gender
    Male

    Default Re: ProgrammersitP

    Quote Originally Posted by The Succubus View Post
    Plus a language to write simple games in would be nice. I recall stuff like Laser Squad and Lords of Chaos from my CPC days and it'd be cool if I could write something like that.
    If you're thinking about Java then they do more than simple games in it--Minecraft is written in Java, for example. I believe it makes use of a thing called the Lightweight Java Game Library to provide 3D capabilities and the like:

    http://lwjgl.org/

  23. - Top - End - #203
    Ogre in the Playground
    Join Date
    Nov 2006

    Default Re: ProgrammersitP

    Quote Originally Posted by The Succubus View Post
    How do folks like my avatar for Basic Avatar Week? Didn't really have enough space to do Visual Basic.

    As for what I'm looking to do in Python, probably a similar thing to shell scripting I guess. As mentioned above, I'm learning about Linux at the moment and it'd be cool if I could build a "toolkit" to do basic automated tasks with.

    Plus a language to write simple games in would be nice. I recall stuff like Laser Squad and Lords of Chaos from my CPC days and it'd be cool if I could write something like that.
    Hmm... shell scripting is probably best done with shell scripting. Might want to look into the bash reference manual for that.

    If you're looking to invoke command line utilities and so on, you should consider C, or perhaps C++ depending on what you're looking to do.

    Simple games programming ... as slow as it is, try pygame.

  24. - Top - End - #204
    Orc in the Playground
     
    Gryffon's Avatar

    Join Date
    Jan 2010
    Location
    Myrtle Beach, SC
    Gender
    Male

    Default Re: ProgrammersitP

    He probably doesn't mean actual shell scripting. Scripting in the bash shell can be horribly mind-wrecking. It's probably best to avoid it. Python is definitely a decent language to get into, and has a pretty low barrier to entry.
    CEO of Evil Incorporated: "Subjugating humanity for a better tomorrow."


  25. - Top - End - #205
    Barbarian in the Playground
     
    BarbarianGuy

    Join Date
    Feb 2010
    Location
    Calgary
    Gender
    Male

    Default Re: ProgrammersitP

    I am new to java and oop so this may sound like a stupid question.

    I create a file called Guess.java.

    In it I include import statements first. Then create a class called Game and the have the Guess class. so it looks like this

    Code:
    import java.stuff
    import java.morestuff
    
    public class Game
    {
        stuff
       
        public void getstuff()
        {
           more stuff
         }
    
        .....
    }
    
    public class Guess
    {
         public static void main(String[] args)
         {
               stufff
    
               Game.getstuff();
               Game.STUFF();
               
               more stuff
               ....
           }
    }
    As you can guess, when I run javac it complains about Game and wants it in it's own file. My thought was I want to use Game in Guess so I made it public and everything in it public. I can't have multiple files so what do I do, make Game private? Put Game in Guess so it looks like:

    Code:
    public class Guess
    {
        public class Game
        {
            stuff
         }
         
         public static void main(Strings[] args)
         {
             Game.stuff
          }
    
    }

  26. - Top - End - #206
    Titan in the Playground
    Join Date
    Mar 2009
    Location
    Sweden
    Gender
    Male

    Default Re: ProgrammersitP

    Quote Originally Posted by Balain View Post
    I am new to java and oop so this may sound like a stupid question.

    I create a file called Guess.java.

    In it I include import statements first. Then create a class called Game and the have the Guess class. so it looks like this

    Spoiler
    Show
    Code:
    import java.stuff
    import java.morestuff
    
    public class Game
    {
        stuff
       
        public void getstuff()
        {
           more stuff
         }
    
        .....
    }
    
    public class Guess
    {
         public static void main(String[] args)
         {
               stufff
    
               Game.getstuff();
               Game.STUFF();
               
               more stuff
               ....
           }
    }


    As you can guess, when I run javac it complains about Game and wants it in it's own file. My thought was I want to use Game in Guess so I made it public and everything in it public. I can't have multiple files so what do I do, make Game private? Put Game in Guess so it looks like:

    Spoiler
    Show
    Code:
    public class Guess
    {
        public class Game
        {
            stuff
         }
         
         public static void main(Strings[] args)
         {
             Game.stuff
          }
    
    }
    Yes, you should be able to put the Game class inside Guess, but no matter what you do, each compiled class is going to end up in its own .class file due to the way Java works (Guess.class and Game$Guess.class (at least I think it was an $)). Are you not allowed to have more than one compiled java file, or does the restriction only affect the source file (.java)?
    Clouddreamer Teddy by me, high above the world, far beyond its matters...

    Spoiler: Banner by Vrythas
    Show

  27. - Top - End - #207
    Barbarian in the Playground
    Join Date
    Nov 2011
    Location
    the crisper drawer

    Default Re: ProgrammersitP

    I've started learning Python fairly recently with the end goal of creating a (relatively) simple computer game.

    I've got most of the basics done, so far—character selection, saving and loading games, etc. But the lack of a GUI is driving me crazy on some fundamental level. And I have a niggling worry that I'll finish the game only to discover that I have to start from scratch because I didn't design my code around the GUI. So I'd like to work on the game logic + GUI simultaneously.

    My problem is trying to find the right combo of language and GUI framework. And I guess the former should take precedence over the latter, so these are the main four I've been looking at:

    • Python: I have a working knowledge of it already, but there seems to be a surprising lack of coherent documentation. I understand that programming is jargon-y by nature, but it feels almost as if the people who write the documentation go out of their way to be exclusive of beginners. Plus there's the whole 2.7/3.x divide that makes the right documentation even harder to find. And a lot of the GUI frameworks for Python seem to be dead projects (e.g. Pygame?).
    • C++: I've heard this is a really good language to know all-around, but I've also heard that it's much more confusing than Python, and much harder to read. And I don't really understand its strengths and weaknesses compared to, say, Python. But it seems to be infinitely better documented.
    • C#: Windows-only, I think? So I'd rather use something else.
    • Java: I'm trying to avoid Java, since I've been told that it's going the way of the dinosaur (perhaps even more quickly due to the recent security problems).

    I don't think there's an engine for the type of game I'm writing (sort of stat-based strategy, strongly text-based), so I'm looking for a framework for now.

    Ideally I'd like something cross-platform. I don't need anything complicated as far as GUI—text, buttons, forms, photos, and that's it. But I have no idea what sort of technical features I'm supposed to be looking for in a framework.

    TL;DR version: For programming a simple(ish) game, is it worth learning a language other than Python in order to have better documentation and GUI frameworks? And what framework should I use?

    ETA: And I've tried TKinter for Python, and it seemed pretty awful. And I've heard people say it's awful compared to a lot of frameworks.
    Last edited by Inglenook; 2013-01-25 at 02:37 AM.

    THE DYING OF THE LIGHT
    A GURPS Zombie Apocalypse Campaign
    always accepting players

  28. - Top - End - #208
    Dwarf in the Playground
    Join Date
    Oct 2007
    Location
    Germany, NRW
    Gender
    Female

    Default Re: ProgrammersitP

    Well there are actually several python game engines/frameworks apart from pygame. You might want to look at cocos2D (There is also a version made for iOS but that's a different engine.)
    For 3D games there is Panda3D, but that is probably overkill for your project anyway.

    The engine I have the most experience with is Ren'Py which is based on pygame. It's build for visual novels, but pretty flexible.
    If you only need a traditional GUI framework instead of a game framework you could try wxpython. It's pretty much the most popular GUI framework at the moment. I find the documentation a bit lacking at times though.

  29. - Top - End - #209
    Colossus in the Playground
     
    BlackDragon

    Join Date
    Feb 2007
    Location
    Manchester, UK
    Gender
    Male

    Default Re: ProgrammersitP

    Quote Originally Posted by Inglenook View Post
    And I have a niggling worry that I'll finish the game only to discover that I have to start from scratch because I didn't design my code around the GUI.
    Visual BASIC aside, you should never write your back-end code in such a way that the GUI has to be a certain way for it to work, because it makes it a pain to change if you decide the GUI isn't right. Have the two things as separate codebases with a strictly defined way of talking to each other!

  30. - Top - End - #210
    Ogre in the Playground
     
    NecromancerGuy

    Join Date
    May 2009

    Default Re: ProgrammersitP

    How important is the platform-independence to you? I admittedly haven't used it much, but C# with .NET seems rather nice. It's easy to pick up from Java or other C-like languages, and it seems pretty easy to code GUIs, especially if you have access to Visual Studio.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •