Programming Practice

Whether you're a newbie or an experienced programmer, any questions, help, or just talk of any language will be welcomed here.

Moderator: Coders of Rage

User avatar
eatcomics
ES Beta Backer
ES Beta Backer
Posts: 2528
Joined: Sat Mar 08, 2008 7:52 pm
Location: Illinois

Re: Programming Practice

Post by eatcomics »

MarauderIIC wrote:Ginto, read beej's guide to network programming linked from here http://elysianshadows.com/phpBB3/viewto ... ?f=6&t=148
link no longer works :nono: that upset me because I've been looking into winsock stuff...
Image
User avatar
eatcomics
ES Beta Backer
ES Beta Backer
Posts: 2528
Joined: Sat Mar 08, 2008 7:52 pm
Location: Illinois

Re: Programming Practice

Post by eatcomics »

KuramaYoko10 wrote:Ok... I dont know if I should bring this topic up again, but I like the idea of it, and I will post a very simple challenge which I remember doing when I was learning the basics of C (which I still am... kinda lol)

You are requested to print on screen X numbers of the fibonacci sequence (starting from 0), being X the variable that the user inputs.
The fibonacci sequence is an interesting sequence of numbers in which you get the previous number, add to your current number to get the result of the next number of the sequence ... here is how it starts:

Code: Select all

0  1  1  2  3  5  8  13  ...
*more info at: http://en.wikipedia.org/wiki/Fibonacci_sequence


I have the code done, but I will try thinking on different ways of solving it, so it will be an exercise to me as well ... I will wait for some replys and then post my code here (and because i am not on my computer right now =P)
darn my lack of motivation, i might have actually liked this one... i guess I'll try but I'll probably lose interest in two minutes... /me runs of to try to code something

Edit: that wikipedia page looks a lot more mathmaticley heavy........
Image
User avatar
eatcomics
ES Beta Backer
ES Beta Backer
Posts: 2528
Joined: Sat Mar 08, 2008 7:52 pm
Location: Illinois

Re: Programming Practice

Post by eatcomics »

got it :mrgreen: do you want me to PM the code or what???
Image
andrew
Chaos Rift Regular
Chaos Rift Regular
Posts: 121
Joined: Mon Dec 08, 2008 2:12 pm

Re: Programming Practice

Post by andrew »

eatcomics wrote:
MarauderIIC wrote:Ginto, read beej's guide to network programming linked from here http://elysianshadows.com/phpBB3/viewto ... ?f=6&t=148
link no longer works :nono: that upset me because I've been looking into winsock stuff...
That link needs to be updated go here. ;)
User avatar
eatcomics
ES Beta Backer
ES Beta Backer
Posts: 2528
Joined: Sat Mar 08, 2008 7:52 pm
Location: Illinois

Re: Programming Practice

Post by eatcomics »

andrew wrote:
eatcomics wrote:
MarauderIIC wrote:Ginto, read beej's guide to network programming linked from here http://elysianshadows.com/phpBB3/viewto ... ?f=6&t=148
link no longer works :nono: that upset me because I've been looking into winsock stuff...
That link needs to be updated go here. ;)
Thankee :worship:
Image
User avatar
KuramaYoko10
Chaos Rift Cool Newbie
Chaos Rift Cool Newbie
Posts: 55
Joined: Fri Oct 31, 2008 8:02 pm

Re: Programming Practice

Post by KuramaYoko10 »

Sure eatcomics... pm me your code, and I will put mine here!

Now, I was looking up my projects folder and I found one that is really fun and might fit as a 'programming practice':

Click here to see the hidden message (It might contain spoilers)
You are requested to do a 'Hang Man' game, in which one player types the word, and a second one tries to guess it by typing a letter at a time...
You have to establish a number of chances to the second player to guess (mine is 7), if he runs out of chances, the first player is the winner!



I will wait till people try to find a way to do this by themselves and then I will post my code here!

Have fun with this one =D
Type a message here!!
[b][color=#BF0000]MarauderIIC[/color][/b] wrote:"Never" is never true in programming.
User avatar
eatcomics
ES Beta Backer
ES Beta Backer
Posts: 2528
Joined: Sat Mar 08, 2008 7:52 pm
Location: Illinois

Re: Programming Practice

Post by eatcomics »

Ginto8 wrote:Here's an idea for the up-and-coming network programmer:
Click here to see the hidden message (It might contain spoilers)
Create a console-based chat program (both server and client). Make it read the server's IP from a configuration file

Also helps with some file I/O. ;)
Hey ginto... could you send me the source for this one plz???? I would love you if you did....... ;)

Edit: That post got me a gold egg :lol: :mrgreen: just thought you would all like to know....
Image
User avatar
Ginto8
ES Beta Backer
ES Beta Backer
Posts: 1064
Joined: Tue Jan 06, 2009 4:12 pm
Programming Language of Choice: C/C++, Java

Re: Programming Practice

Post by Ginto8 »

eatcomics wrote:
Ginto8 wrote:Here's an idea for the up-and-coming network programmer:
Click here to see the hidden message (It might contain spoilers)
Create a console-based chat program (both server and client). Make it read the server's IP from a configuration file

Also helps with some file I/O. ;)
Hey ginto... could you send me the source for this one plz???? I would love you if you did....... ;)

Edit: That post got me a gold egg :lol: :mrgreen: just thought you would all like to know....
:lol: to be honest I haven't made one myself yet... though I'll need to soon, if I want to actually finish my next project! Here's my list of ideas for it if you want to know:
Click here to see the hidden message (It might contain spoilers)
  • -sidescrolling
    -splitscreen
    -2D
    -a shooter
    -server can upload their own sprite/tile sheet to replace the default one
    -made with SDL/OpenGL
    -uses SDL_net for networking


and if you want a (sorta) cross-platform networking solution, then you can use SDL_net instead of winsock ;)
Quit procrastinating and make something awesome.
Ducky wrote:Give a man some wood, he'll be warm for the night. Put him on fire and he'll be warm for the rest of his life.
User avatar
eatcomics
ES Beta Backer
ES Beta Backer
Posts: 2528
Joined: Sat Mar 08, 2008 7:52 pm
Location: Illinois

Re: Programming Practice

Post by eatcomics »

cool I'll look into the SDL_net thing thanx ;)
Image
User avatar
BlueMonkey5
Chaos Rift Cool Newbie
Chaos Rift Cool Newbie
Posts: 86
Joined: Fri Feb 20, 2009 12:54 am

Re: Programming Practice

Post by BlueMonkey5 »

Can anyone tell me anything about DarkBasic? and is a good place to start for a total beginner?
User avatar
MarauderIIC
Respected Programmer
Respected Programmer
Posts: 3406
Joined: Sat Jul 10, 2004 3:05 pm
Location: Maryland, USA

Re: Programming Practice

Post by MarauderIIC »

No idea, blue.
I realized the moment I fell into the fissure that the book would not be destroyed as I had planned.
User avatar
BlueMonkey5
Chaos Rift Cool Newbie
Chaos Rift Cool Newbie
Posts: 86
Joined: Fri Feb 20, 2009 12:54 am

Re: Programming Practice

Post by BlueMonkey5 »

Wikipedia sais that the purpose of the language is to "create games using microsofts directX from a BASIC programming language". It's basically a customized language specifically geared to make games, that has the necessary libraries built right into it. So there's no need for API's i guess. It's kind of like a two in one thing from what I see but I don't know if it's worth while to learn, or if it's just better to start right away with a normal languge, like C++ with SDL or something. So maybe someone has a recomendation about that.
User avatar
dandymcgee
ES Beta Backer
ES Beta Backer
Posts: 4709
Joined: Tue Apr 29, 2008 3:24 pm
Current Project: https://github.com/dbechrd/RicoTech
Favorite Gaming Platforms: NES, Sega Genesis, PS2, PC
Programming Language of Choice: C
Location: San Francisco
Contact:

Re: Programming Practice

Post by dandymcgee »

BlueMonkey5 wrote: It's kind of like a two in one thing from what I see but I don't know if it's worth while to learn, or if it's just better to start right away with a normal languge, like C++ with SDL or something. So maybe someone has a recomendation about that.
Really the only thing that matters is how much difficulty you wish to deal with as a beginner. Obviously DarkBasic will be much easier to learn, and you may even be able to start making a simple game within the first week. C++ on the other hand will require a lot more patience to master and the beginner tutorials may seem less appealing to you (guess a number game, draw simple ascii art, whatever), but will definitely give you many more options in the long run.

It's up to you to make this decision, and if you're Really unsure go ahead and jump right into C++ and see if you think you can handle it. If not go ahead with DarkBasic first, and work your way towards C++ later on. I tried and failed at learning C++ at least twice before I actually got serious and became determined to understand it. There's nothing wrong with failing the very first time you try something new (unless of course it has to do with sky-diving). ;)
Falco Girgis wrote:It is imperative that I can broadcast my narcissistic commit strings to the Twitter! Tweet Tweet, bitches! :twisted:
User avatar
BlueMonkey5
Chaos Rift Cool Newbie
Chaos Rift Cool Newbie
Posts: 86
Joined: Fri Feb 20, 2009 12:54 am

Re: Programming Practice

Post by BlueMonkey5 »

LOL... nice. yea that sounds really cool. it's actually a big comfort hearing that you failed the first two times (as twisted as that sounds), because I failed two times at programming too! so wow, that actually does inspire me some and gives me hope that i can give it another whack. thanks!

But here's a good question if anyone knows- is darkbasic similar to C++? so basically, if i start off learning darkbasic, will it be an easy switch to learn C++? if it is, it would be worth while to do that and then make the switch. if they are similar, alongside being useful, learning darkbasic would also be practice when switching to C++. it would be like learning something to help getting started with that. but if they're totally different, i would just start off with C, and maybe play around with darkbasic on the side to see what it's all about.
User avatar
eatcomics
ES Beta Backer
ES Beta Backer
Posts: 2528
Joined: Sat Mar 08, 2008 7:52 pm
Location: Illinois

Re: Programming Practice

Post by eatcomics »

BlueMonkey5 wrote:LOL... nice. yea that sounds really cool. it's actually a big comfort hearing that you failed the first two times (as twisted as that sounds), because I failed two times at programming too! so wow, that actually does inspire me some and gives me hope that i can give it another whack. thanks!

But here's a good question if anyone knows- is darkbasic similar to C++? so basically, if i start off learning darkbasic, will it be an easy switch to learn C++? if it is, it would be worth while to do that and then make the switch. if they are similar, alongside being useful, learning darkbasic would also be practice when switching to C++. it would be like learning something to help getting started with that. but if they're totally different, i would just start off with C, and maybe play around with darkbasic on the side to see what it's all about.
just keep at it, especially when you don't feel like doing it. You get a big boost of confidence that way :mrgreen:
Image
Post Reply