Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Poll

What programming topic would you want the next challenge to be about?  (It might be a good opportunity to focus on a subject you're not familiar with or to reinforce knowledge on one that you already know)

Control Flow
- 2 (2.2%)
Arrays, Strings, Pointers, and References
- 8 (9%)
Functions
- 4 (4.5%)
Basic object-oriented programming
- 30 (33.7%)
A bit more advanced OOP (Composition, Operator overloading, Inheritance, Virtual Functions)
- 18 (20.2%)
Templates
- 8 (9%)
Other (Explain)
- 4 (4.5%)
Working with files?  (Streams)
- 15 (16.9%)

Total Members Voted: 89


Pages: 1 2 3 [4] 5 6 ... 78

Author Topic: Programming Challenges & Resources (#bay12prog) Initiative  (Read 95669 times)

DrPizza

  • Bay Watcher
    • View Profile
    • Ars Technica
Re: Programming Challenges & Resources (#bay12prog) Innitiative
« Reply #45 on: May 24, 2010, 10:58:04 am »

Ohoohoo this is just my thing. Let me open up GCC and get started. I'm not sure what I'll do yet, though. I'm great with C/C++.
Practically by definition, you are not.

There is no such language as "C/C++". There is C, and there is C++, and they share some aspects of their grammar and libraries, but the differences are legion. The languages are not source code compatible, and their coding styles are so radically different that knowledge of one confers practically no knowledge of the other.
Logged

HideousBeing

  • Bay Watcher
    • View Profile
Re: Programming Challenges & Resources (#bay12prog) Innitiative
« Reply #46 on: May 24, 2010, 12:02:20 pm »

Ohoohoo this is just my thing. Let me open up GCC and get started. I'm not sure what I'll do yet, though. I'm great with C/C++.
Practically by definition, you are not.

There is no such language as "C/C++". There is C, and there is C++, and they share some aspects of their grammar and libraries, but the differences are legion. The languages are not source code compatible, and their coding styles are so radically different that knowledge of one confers practically no knowledge of the other.

Don't get nitpicky; he could be good at both languages. Save this for when people ask if they should learn C or C++ or what the differances are between them.

Thanks for the thread. There are some fun challanges and learncpp.com is pretty good. I've known some very basic C++ for a few years but haven't really touched it mostly because of lack of inspiration. Now I'm going to go try and make some stuff that actually utilizes OOP decently.
Logged

Blacken

  • Bay Watcher
  • Orange Polar Bear
    • View Profile
Re: Programming Challenges & Resources (#bay12prog) Innitiative
« Reply #47 on: May 24, 2010, 01:12:42 pm »

He's right. There are maybe two thousand people around the world who are "great" C or C++ programmers. I would bet any amount you wished that none of them post here.
Logged
"There's vermin fish, which fisherdwarves catch, and animal fish, which catch fisherdwarves." - Flame11235

DrPizza

  • Bay Watcher
    • View Profile
    • Ars Technica
Re: Programming Challenges & Resources (#bay12prog) Innitiative
« Reply #48 on: May 24, 2010, 01:25:59 pm »

Quote
Don't get nitpicky; he could be good at both languages.
He could, but it's vanishingly unlikely, because people who are good at both languages--or even one of the languages--know better than to lump them together like that.


Logged

HideousBeing

  • Bay Watcher
    • View Profile
Re: Programming Challenges & Resources (#bay12prog) Innitiative
« Reply #49 on: May 24, 2010, 02:26:30 pm »

This is a c++ tutorial that teaches beginners by making a roguelike that was over in the roguelike development thread.

Terror in ASCII Dungeon!:

part 1
part 2
part 3
part 4

EDIT: Sorry, ending derail. My bad.
« Last Edit: May 24, 2010, 04:20:37 pm by HideousBeing »
Logged

Blacken

  • Bay Watcher
  • Orange Polar Bear
    • View Profile
Re: Programming Challenges & Resources (#bay12prog) Innitiative
« Reply #50 on: May 24, 2010, 03:51:29 pm »

Nobody's "bashing" anyone. A critical aspect to programming (and any field, really) is understanding and accepting how very little you actually do know. I've been programming for 11 years and I wouldn't call myself "great" at anything; I'm a pretty good .NET developer, I'm okay at a lot of other things, but "great"? Don't be silly.
Logged
"There's vermin fish, which fisherdwarves catch, and animal fish, which catch fisherdwarves." - Flame11235

Outcast Orange

  • Bay Watcher
  • [SOMETIMES_SQUID]
    • View Profile
    • The Outcast Orange
Re: Programming Challenges & Resources (#bay12prog) Innitiative
« Reply #51 on: May 24, 2010, 11:52:58 pm »

Please take your issue to private messages.

This is where I come for programly things, or to offer help or answer questions.

Every time there is a new post in this thread,
 I am a bit excited to read something by one of my favorite B12 contributors,
 and there has only been drama the last half-dozen posts.

It is very late, and I will be enjoying a banana soon.

Logged
[7:53:55 PM] Armok, why did you demand that I don't eat you?
[7:54:34 PM] [Armok]: woooooo

Burried Houses - Platform Explorer Demo H - Cloud Scream

eerr

  • Bay Watcher
    • View Profile
Re: Programming Challenges & Resources (#bay12prog) Innitiative
« Reply #52 on: May 25, 2010, 02:08:44 pm »

Is anybody working on Iphone apps?

Just got a mac recently.

Logged

timmeh

  • Bay Watcher
    • View Profile
    • My Portfolio
Re: Programming Challenges & Resources (#bay12prog) Innitiative
« Reply #53 on: May 25, 2010, 02:55:14 pm »

From what I've heard, getting an iPhone app approved can be a royal pain... just hear-say though, don't know if there's any truth in it.  Still, if I were going to develop for a smart-phone, I'd probably shoot for the Droid, seems to have a more "open-source oriented" community.
Logged
On the Wall is a Masterfully engraved carving of Urist McHardcastle and Goblins. Urist McHardcastle is surrounded by the Goblins. The Golbins are stamping on Urist McHardcastle. Urist McHardcaste is laughing at the Goblins. The carving related to the prolonged and bloody death of Urist McHardcastle in the Fall of 1659, the Winter of 1659, and the Spring of 1660. On the engraving is an image of Cheese.

eerr

  • Bay Watcher
    • View Profile
Re: Programming Challenges & Resources (#bay12prog) Innitiative
« Reply #54 on: May 26, 2010, 02:53:00 am »

From what I've heard, getting an iPhone app approved can be a royal pain... just hear-say though, don't know if there's any truth in it.  Still, if I were going to develop for a smart-phone, I'd probably shoot for the Droid, seems to have a more "open-source oriented" community.

My brother is a machine, I would actually be developing a feature he doesn't have time to add.
And way slower at it, but still.

Logged

Siquo

  • Bay Watcher
  • Procedurally generated
    • View Profile
Re: Programming Challenges & Resources (#bay12prog) Innitiative
« Reply #55 on: May 26, 2010, 03:29:02 am »

Problem: World and Material Types.

So, I need a collection of MaterialTypes, that contain data such as texturenumber, density, hardness et cetera, and link those to every object in the world.
Solutions:
- A: A std::map with <integer, MaterialType>, and an int per object
- B: A pointer to the MaterialType per object
- C: Something else?

I really don't want the collection to be a "global", as globals are evil, but I'm not sure how else to do it.
Maybe use solution A, create the collection as a static singleton, with a (static?) pointer to the collection from every object? (AKA: cpp global)
And if the object doesn't know where the collection is, how can I use option B to get a pointer to one of the MaterialTypes?

An object only knows it's x,y,z relative to its parent, and has a pointer to its parent. The top-level parent is "world", I could create the collection there, but traversing the entire tree of pointer-to-parents for every check is not efficient... Unless I make a pointer to the MaterialType, and set it only at object creation (or if the type changes).
Logged

This one thread is mine. MIIIIINE!!! And it will remain a happy, friendly, encouraging place, whether you lot like it or not. 
will rena,eme sique to sique sxds-- siquo if sucessufil
(cant spel siqou a. every speling looks wroing (hate this))

darius

  • Bay Watcher
  • ^^
    • View Profile
Re: Programming Challenges & Resources (#bay12prog) Innitiative
« Reply #56 on: May 26, 2010, 05:09:04 am »

I'm sure pointers are faster. As for map, I use it in singleton. One of more complex implementations was that each material had it's two id's (type, subtype) and cells had pointer to material. Materials in singleton with two maps (one inside another). The idea was to be able to add/ remove materials on the fly.
But if you are using std::map <integer ,sth> is it not better (faster) to use std::vector <sth> ,or std::vector <sth*>?
Logged

Siquo

  • Bay Watcher
  • Procedurally generated
    • View Profile
Re: Programming Challenges & Resources (#bay12prog) Innitiative
« Reply #57 on: May 26, 2010, 05:20:20 am »

True, but not if I have 1000s of materials, created on the fly using the id as seed-salt.

So there might be material 134, 14895 and 400372, and nothing else. If it's not found, it's created on the fly.

Poor fly.
Logged

This one thread is mine. MIIIIINE!!! And it will remain a happy, friendly, encouraging place, whether you lot like it or not. 
will rena,eme sique to sique sxds-- siquo if sucessufil
(cant spel siqou a. every speling looks wroing (hate this))

qwertyuiopas

  • Bay Watcher
  • Photoshop is for elves who cannot use MSPaint.
    • View Profile
    • uristqwerty.ca, my current (barren) site.
Re: Programming Challenges & Resources (#bay12prog) Innitiative
« Reply #58 on: May 26, 2010, 07:08:22 am »

Whenever someone says that globals are evil, they are generalizing too much.

If you know why they say they are, then you might find some circumstances where a global variable is best anyway.
Logged
Eh?
Eh!

Siquo

  • Bay Watcher
  • Procedurally generated
    • View Profile
Re: Programming Challenges & Resources (#bay12prog) Innitiative
« Reply #59 on: May 26, 2010, 08:19:35 am »

Oh, I know. Evil just means "good on only VERY RARE occasions". I do play DF, you know ;)

Although just typing the question here already gave me some answers. As I'll be having a LOT of objects, every pointer and int counts. But so does accessing speed.

As I have a "world", and everything is contained by that, I should put all "global" into the "world", since those two words almost mean the same anyway :)
All objects get a static pointer to the world. There's my evil "global". This prevents having to recursively "getParent()" until you reach the World all the time. Static == global and uglyish but I don't plan on multiple worlds anyway, so I should be good there. Static pointers also only take up space once, so it costs me nothing.
From then on, all global calls can go through World, and I still don't have to make use of singletons or something.


I also am preventing a headache by not thinking about abstracted mixed-material objects.
Logged

This one thread is mine. MIIIIINE!!! And it will remain a happy, friendly, encouraging place, whether you lot like it or not. 
will rena,eme sique to sique sxds-- siquo if sucessufil
(cant spel siqou a. every speling looks wroing (hate this))
Pages: 1 2 3 [4] 5 6 ... 78