Re: Programming Practice
Posted: Tue Mar 24, 2009 6:13 pm
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.
The Next Generation of 2D Roleplaying Games
http://elysianshadows.com/phpBB3/
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.
Omg.Arce wrote:Make an executable output it's own source.
Good luck. ^.^
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. ^.^
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.
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;
}
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!
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).
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. ^.^
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
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.
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
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).
I dunno. Google tells me how to do it though.4) Write a quin. A program that outputs it's own source.
<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>