Programming Practice
Moderator: Coders of Rage
- BlueMonkey5
- Chaos Rift Cool Newbie
- Posts: 86
- Joined: Fri Feb 20, 2009 12:54 am
Re: Programming Practice
yea, youre totally right... i'm getting too nit-picky. i'm just gonna get them both and check them both out. whichever one sticks, we'll see.
Re: Programming Practice
You should probably watch this: http://www.youtube.com/watch?v=zAgpsks2 ... 98&index=0 and the next twoBlueMonkey5 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.
They pull out the truncheon, that's when the trouble starts.
'Cause when you've got a badge, the laws don't apply.
'Cause when you've got a badge, the laws don't apply.
- BlueMonkey5
- Chaos Rift Cool Newbie
- Posts: 86
- Joined: Fri Feb 20, 2009 12:54 am
Re: Programming Practice
cool, thanks :D
Re: Programming Practice
Make an executable output it's own source.
Good luck. ^.^
Good luck. ^.^
<qpHalcy0n> decided to paint the office, now i'm high and my hands hurt
- dandymcgee
- 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
Omg.Arce wrote:Make an executable output it's own source.
Good luck. ^.^
Quines are EVIL!
Falco Girgis wrote:It is imperative that I can broadcast my narcissistic commit strings to the Twitter! Tweet Tweet, bitches!
- M_D_K
- Chaos Rift Demigod
- Posts: 1087
- Joined: Tue Oct 28, 2008 10:33 am
- Favorite Gaming Platforms: PC
- Programming Language of Choice: C/++
- Location: UK
Re: Programming Practice
I was talking to avansc about that one time(I was going to submit it here as a challenge)Arce wrote:Make an executable output it's own source.
Good luck. ^.^
Gyro Sheen wrote:you pour their inventory onto my life
IRC wrote: <sparda> The routine had a stack overflow, sorry.
<sparda> Apparently the stack was full of shit.
Re: Programming Practice
Did that, interesting little challenge. For me anywayM_D_K wrote:OK I have one for yout all. Now it seems alot of programmers(experienced ones too) have problems figuring this one out.
OK so here it is
Click here to see the hidden message (It might contain spoilers)
Seems easy but I know people who have been scratching their respective heads on this. When I heard of it I figured it out in like 10 seconds
EDIT: You don't have to make it recursive but bonus points if you do.
Good Luck.
I haven't tested it completely, the numbers look right though.
Code: Select all
#include <iostream>
#include <stdio.h>
#include <math.h>
using namespace std;
int main()
{
double intpart;
double a;
for (double n = 1;n < 101;n++)
{
a = modf (n/3,&intpart);
if (a == 0)
{
cout << "foo";
}
a = modf(n/5,&intpart);
if (a==0)
{
cout << "bar ";
}
{
cout << n << endl;
}
}
system("PAUSE");
return 0;
}
They pull out the truncheon, that's when the trouble starts.
'Cause when you've got a badge, the laws don't apply.
'Cause when you've got a badge, the laws don't apply.
- LuciDreamTheater
- Chaos Rift Newbie
- Posts: 39
- Joined: Tue Jan 20, 2009 2:18 am
- Location: Southern CA
- Contact:
Re: Programming Practice
Here's a twist: Write a program that reads in a text file and determines whether it is it's own source code. (Note: Cannot read the source file).dandymcgee wrote:Omg.Arce wrote:Make an executable output it's own source.
Good luck. ^.^
Quines are EVIL!
- dandymcgee
- 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
What kind of sick twisted person thinks up something like this?anothrguitarist wrote: Here's a twist: Write a program that reads in a text file and determines whether it is it's own source code. (Note: Cannot read the source file).
Falco Girgis wrote:It is imperative that I can broadcast my narcissistic commit strings to the Twitter! Tweet Tweet, bitches!
Re: Programming Practice
That was the #4 program for the competition I won last weekend.M_D_K wrote:I was talking to avansc about that one time(I was going to submit it here as a challenge)Arce wrote:Make an executable output it's own source.
Good luck. ^.^
It's a team challenge. Each team is 4 members and can only have one laptop. Programs can be written in any language. You have 2 hours to complete 4 programs and present them to a panel of judges.
They are sorted in order of difficulty. Ours were something like this:
1) Read in a comma separated list of words. Display each word only once, but increase the size for the amount of repetitions of the word entered.
Example input:
this,this,this,this,small,gay,gay,hi,sup,hi
Example Output:
this, small, sup , gay, hi
Should handle spacing correctly. Order of output does not matter.
2) Read a maze into an array. 'X' denotes a wall (unwalkable space), 'O' a walkable position, 'S' starting point, and 'E' ending point. Assume that no maze has circles/repeating spots. Write a program to display the coordinates (in order) that one would have to follow to reach the end of the maze. You cannot backtracks (repeat coordinates). Only traverse in cardinal directions.
Example input:
Code: Select all
X X S X X X X X X X
X X O X X X X X X X
X X O O O O O X X X
X X O X X X O O X X
X X O O O O X X X X
X X X X X O X X X X
X X X X X O X X X X
X X X O O O O O X X
X X X O X X X O X X
X X X X X X X E X X
3) Some dipshit has problems sorting .txt files on his desktop. He needs you to help him out. Write a program to parse through all text files on the desktop, read in 3 space-separated words from that files, and rename the files to those three words (replacing spaces with underscores and ignore non-alphanumeric characters characters). If there is less than three words in the file, only use the words that are found. If there is already a file with the existing name, prefix the name numerically (rename the first with a 1, second with a 2, etc).
4) Write a quin. A program that outputs it's own source.
Surprisingly, we got first place trophies. I had a kind or argument with a judge over #2, and he didn't like our #4 solution.
Will be going to state for this one, too. (in addition to the level editor stuff). I'll let ya know if I get any loot! Also, lemme know if anybody else here thinks they can get all 4 done in 2 hours (I almost call bullshit on that).
I ended up doing one in Blitz, one in Java, one in C++, and one in nothing/Java/C++.
<qpHalcy0n> decided to paint the office, now i'm high and my hands hurt
- MarauderIIC
- Respected Programmer
- Posts: 3406
- Joined: Sat Jul 10, 2004 3:05 pm
- Location: Maryland, USA
Re: Programming Practice
<bored>
Here's how I'd do them, for the interested :P
</bored>
Here's how I'd do them, for the interested :P
Arce wrote: That was the #4 program for the competition I won last weekend.
It's a team challenge. Each team is 4 members and can only have one laptop. Programs can be written in any language. You have 2 hours to complete 4 programs and present them to a panel of judges.
They are sorted in order of difficulty. Ours were something like this:
1) Read in a comma separated list of words. Display each word only once, but increase the size for the amount of repetitions of the word entered.
Example input:
this,this,this,this,small,gay,gay,hi,sup,hi
Example Output:
this, small, sup , gay, hi
Should handle spacing correctly. Order of output does not matter.
Click here to see the hidden message (It might contain spoilers)
2) Read a maze into an array. 'X' denotes a wall (unwalkable space), 'O' a walkable position, 'S' starting point, and 'E' ending point. Assume that no maze has circles/repeating spots. Write a program to display the coordinates (in order) that one would have to follow to reach the end of the maze. You cannot backtracks (repeat coordinates). Only traverse in cardinal directions.
Example input:Output: (too lazy to type, fuck you.)Code: Select all
X X S X X X X X X X X X O X X X X X X X X X O O O O O X X X X X O X X X O O X X X X O O O O X X X X X X X X X O X X X X X X X X X O X X X X X X X O O O O O X X X X X O X X X O X X X X X X X X X E X X
Click here to see the hidden message (It might contain spoilers)
3) Some dipshit has problems sorting .txt files on his desktop. He needs you to help him out. Write a program to parse through all text files on the desktop, read in 3 space-separated words from that files, and rename the files to those three words (replacing spaces with underscores and ignore non-alphanumeric characters characters). If there is less than three words in the file, only use the words that are found. If there is already a file with the existing name, prefix the name numerically (rename the first with a 1, second with a 2, etc).
Click here to see the hidden message (It might contain spoilers)
I dunno. Google tells me how to do it though.4) Write a quin. A program that outputs it's own source.
</bored>
I realized the moment I fell into the fissure that the book would not be destroyed as I had planned.
Re: Programming Practice
<bull>Oh man! You really showed marcel that it's possible! </bull>MarauderIIC wrote:<bored>
Here's how I'd do them, for the interested :P
Arce wrote: That was the #4 program for the competition I won last weekend.
It's a team challenge. Each team is 4 members and can only have one laptop. Programs can be written in any language. You have 2 hours to complete 4 programs and present them to a panel of judges.
They are sorted in order of difficulty. Ours were something like this:
1) Read in a comma separated list of words. Display each word only once, but increase the size for the amount of repetitions of the word entered.
Example input:
this,this,this,this,small,gay,gay,hi,sup,hi
Example Output:
this, small, sup , gay, hi
Should handle spacing correctly. Order of output does not matter.Click here to see the hidden message (It might contain spoilers)
2) Read a maze into an array. 'X' denotes a wall (unwalkable space), 'O' a walkable position, 'S' starting point, and 'E' ending point. Assume that no maze has circles/repeating spots. Write a program to display the coordinates (in order) that one would have to follow to reach the end of the maze. You cannot backtracks (repeat coordinates). Only traverse in cardinal directions.
Example input:Output: (too lazy to type, fuck you.)Code: Select all
X X S X X X X X X X X X O X X X X X X X X X O O O O O X X X X X O X X X O O X X X X O O O O X X X X X X X X X O X X X X X X X X X O X X X X X X X O O O O O X X X X X O X X X O X X X X X X X X X E X X
Click here to see the hidden message (It might contain spoilers)3) Some dipshit has problems sorting .txt files on his desktop. He needs you to help him out. Write a program to parse through all text files on the desktop, read in 3 space-separated words from that files, and rename the files to those three words (replacing spaces with underscores and ignore non-alphanumeric characters characters). If there is less than three words in the file, only use the words that are found. If there is already a file with the existing name, prefix the name numerically (rename the first with a 1, second with a 2, etc).Click here to see the hidden message (It might contain spoilers)
I dunno. Google tells me how to do it though.4) Write a quin. A program that outputs it's own source.
</bored>