• Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • It's time to vote for your favorite Pokémon Battle Revolution protagonist in our new weekly protagonist poll! Click here to cast your vote and let us know which PBR protagonist you like most.
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

Programming!

Moving away from C definitely doesn't mean 'throwing a lot of language design knowledge' — imperative languages aren't the only type out there. Implying that a shift in hardware is required for a shift in language design is like saying that functional and logic-based languages couldn't exist at all, but they do.

I didn't mean to imply that imperative languages were the only types out there. However, imperative is one of the main paradigms. Thus if we lost it, we would be throwing quite a lot (notice I did not say all) of our principles of language design out. Most general-purpose languages today are multi-paradigm and contain a mix of styles - imperative being quite a large component of these languages. Languages that emphasise declarative styles more such as Haskell (Functional) and Prolog (Logic) are pretty niche.

As for the shift in hardware, I was trying to make a point that it would only make sense to depart from imperative programming entirely (in mainstream languages) if the paradigm no longer made sense. I make this point because in the end, all languages are reduced to a byte code which is unstructured and imperative.
 
All I can really say is that I enjoy C++ and will continue to learn it, and I'm still using Code::Blocks at the moment - however, I will try using a text editor for the experience.

----

Would anyone be able to help me with adding the RANDOM.ORG library to a program, and having the program request integers from it? I have absolutely no idea what I'm supposed to do with the library files. It seems like it would be really simple, but I am stumped ~_~

It's for my Mafia Player-Role List Generator, which I would much rather have its randomness sourced from random.org than the PRNG.
 
All I can really say is that I enjoy C++ and will continue to learn it, and I'm still using Code::Blocks at the moment - however, I will try using a text editor for the experience.

----

Would anyone be able to help me with adding the RANDOM.ORG library to a program, and having the program request integers from it? I have absolutely no idea what I'm supposed to do with the library files. It seems like it would be really simple, but I am stumped ~_~

It's for my Mafia Player-Role List Generator, which I would much rather have its randomness sourced from random.org than the PRNG.

If you want to access the internet for practise, you might want to try libcurl or something. cURL is a popular utility for data transfer and supports a wide variety of protocols, including HTTP(S).

It really depends on what compiler you're using and what platform you're on. On Linux, if you have libcurl installed you can just compile with the -lcurl flag and it will find and link in the library. On Windows it might be a bit more complicated, I don't know though. IDE's usually have their own configuration window for this kind of thing. First you'll want to try

Code:
#include <curl/curl.h>

And the compiler should complain. If it does, you need to configure the IDE to set the include path while compiling. Usually this is done in a project configuration menu. With GCC you simply need to add -I/path/to/includes. Once you have the header working, you need to point it to your shared library (.dll on Windows). Usually this just involves you setting the library paths in project configuration (this is much easier on command line imo)

Try compiling a basic example like https://raw.githubusercontent.com/bagder/curl/master/docs/examples/simple.c by itself first, then try to incorporate it into your project.
 
At the current rate, while HTML/JS tech does offer an alternative to developing mobile apps, they're hardly comparable to your typical native app- at no fault of the technologies involved. Mobile browsers are still significantly underpowered compared to their desktop siblings, and while that's likely going to change as high-end and mid-range devices increase in power, you're still potentially offering an inferior experience for users on lower end devices. This is key, especially if you consider that the emerging economies outside of the West are going to be where the biggest boom for mobile is in the coming years as access to mobile devices and mobile internet increase.

If you're continuing to work with C++, I might recommend moving to Qt Creator instead. While Code::Blocks is a decent IDE, you'll benefit much more from Qt Creator and developing with the Qt platform in mind, especially now that Qt supports is fairly well supported across all the major operating systems, including Android, iOS, and Windows Phone. That's assuming that you're interested in writing user facing applications- if you're more interested in writing libraries and frameworks, Qt Creator doesn't have too much to offer that you can't get elsewhere.

As far as I can tell, though, RANDOM.ORG does not have a C++ specific library. They do offer an HTTP API, so you could access that from anywhere. If you're looking for a means to provide better randomness than the built in functionality, you can always use something like PCG, especially if you don't want to add internet functionality.
 
As far as I can tell, though, RANDOM.ORG does not have a C++ specific library. They do offer an HTTP API, so you could access that from anywhere. If you're looking for a means to provide better randomness than the built in functionality, you can always use something like PCG, especially if you don't want to add internet functionality.

Another thing you could potentially add is a Mersenne Twister RNG library. It's (From what I've heard) one of the best RNG libraries you can find - The Pokémon games use the same library for random number generation.
While it would perhaps be simpler to add a good PRNG to the program, it would provide potentially worse results than someone just directly going to RANDOM.ORG to generate it themselves, which would just defeat the purpose of the program.

When I add RANDOM.ORG to the program, if I can do it, it will retain the current random method of the bad PRNG that uses the Unix time as a seed as an option, but it will not be recommended.

If I fail to add RANDOM.ORG generation to the program, I might have to use a PRNG. But I'm hoping that won't happen, and as long as I can work it out I won't have to compromise. Especially since, as I said above, it would make the program mostly useless if it offers worse results.
 
Doesn't that also add an internet connection dependency to your application though?
Yes, but only if you use the RANDOM.ORG generation; I'm keeping offline generation as an option. And besides, you need an internet connection to actually be hosting a Mafia game here on the forums, which the purpose of the program is supposed to assist in.

I might even try adding one of the better offline PRNGs as an option as well, if I can work it out. I'll see.

Once I've finished everything else, how difficult is putting a console application to a GUI one if I've already made it work as a console application? I'll probably fail at it if I try, as it's still not something I've explored or learned yet. But I did manage to do a lot of other stuff, so the program is practically done aside from the random generation.
 
Back
Top