Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1] 2 3

Author Topic: The Place For Any Programs You Wrote That Aren't Really Worthy Of Anything  (Read 4842 times)

qwertyuiopas

  • Bay Watcher
  • Photoshop is for elves who cannot use MSPaint.
    • View Profile
    • uristqwerty.ca, my current (barren) site.

So I wrote a simple program that pould take a random line for a text file, and write it, but anything within square brackets would be treated as a filename to recurse into. Basically, a simple text substitution system that used a random line from the target file.
Then adding 256 text storage things, some rewriting to output to strings rather than directly, and then other stuff...

Well, I want to share it with the forum, but it isn't good enough for a place of it's own.

So here it is:
Spoiler (click to show/hide)
(Edit: added some libraries and changed the poor quality srand() mechanism that uses a file to save the last rand() into one that uses time(). The only error with -Wall is about getch(), but I don't know where getch() is implemented...)


This is the place for anyone else to share small programs that aren't really notably good at anything.
« Last Edit: December 08, 2009, 05:48:12 pm by qwertyuiopas »
Logged
Eh?
Eh!

Outcast Orange

  • Bay Watcher
  • [SOMETIMES_SQUID]
    • View Profile
    • The Outcast Orange
Re: The Place For Any Programs You Wrote That Aren't Really Worthy Of Anything
« Reply #1 on: December 08, 2009, 08:00:00 pm »

I have endless projects like this, but they exist in a language which can't be compiled anymore.
Makes me sort of sad.
They were all pretty useless anyways.
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

Jack_Bread

  • Bay Watcher
  • 100% FRESH ♥HIPPO♥
    • View Profile
Re: The Place For Any Programs You Wrote That Aren't Really Worthy Of Anything
« Reply #2 on: December 08, 2009, 09:12:19 pm »

Besides generic "Hello World" derivatives, I've got nothing. :P

quinnr

  • Bay Watcher
    • View Profile
Re: The Place For Any Programs You Wrote That Aren't Really Worthy Of Anything
« Reply #3 on: December 08, 2009, 09:21:06 pm »

I once made a PHP script that would randomly pick a number 1 to 100, and see if you guessed it right. As I couldn't tell if it actually worked, I made it tell me what the numbers were. I never got it to match though, so it might not have even worked.
Logged
To exist or not exist, that is the query. For whether it is more optimal of the CPU to endure the viruses and spam of outragous fortune, or to something something something.

Bricks

  • Bay Watcher
  • Because you never need one brick.
    • View Profile
Re: The Place For Any Programs You Wrote That Aren't Really Worthy Of Anything
« Reply #4 on: December 08, 2009, 09:49:23 pm »

Woah, I've made a mad-libs style program just like that.  Kuh-razy.
Logged
EMPATHY - being able to feel other peoples' stuff.

eerr

  • Bay Watcher
    • View Profile
Re: The Place For Any Programs You Wrote That Aren't Really Worthy Of Anything
« Reply #5 on: December 09, 2009, 12:35:34 am »

I can't think of anything interesting to write, with what I can do now.

I might copy cinnamon rolls for java though.
Logged

cowofdoom78963

  • Bay Watcher
  • check
    • View Profile
Re: The Place For Any Programs You Wrote That Aren't Really Worthy Of Anything
« Reply #6 on: December 09, 2009, 12:49:59 am »

Being new at programming just about everything Ive done is one of these.
Logged

Cheeetar

  • Bay Watcher
  • Spaceghost Perpetrator
    • View Profile
Re: The Place For Any Programs You Wrote That Aren't Really Worthy Of Anything
« Reply #7 on: December 09, 2009, 06:36:10 am »

Being new at programming just about everything Ive done is one of these.
Logged
I've played some mafia.

Most of the time when someone is described as politically correct they are simply correct.

Berserker

  • Bay Watcher
    • View Profile
Re: The Place For Any Programs You Wrote That Aren't Really Worthy Of Anything
« Reply #8 on: December 09, 2009, 06:37:22 am »

Python is fun.

Code: [Select]
print ', '.join(map(str, sorted([int(raw_input('Number '+str(n+1)+'? ')) for n in range(int(raw_input('How many numbers? ')))])))(Everything is in one line)

First it asks how many numbers to take, and then it asks the numbers and finally prints them in sorted order.
Logged

Outcast Orange

  • Bay Watcher
  • [SOMETIMES_SQUID]
    • View Profile
    • The Outcast Orange
Re: The Place For Any Programs You Wrote That Aren't Really Worthy Of Anything
« Reply #9 on: December 09, 2009, 10:40:12 am »

Give it 5 years, and Python will take over the Chinese government.
It will become self-aware, then write a program to control minds.
And that program will only be 8 trinary characters long.
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

Nadaka

  • Bay Watcher
    • View Profile
    • http://www.nadaka.us
Re: The Place For Any Programs You Wrote That Aren't Really Worthy Of Anything
« Reply #10 on: December 09, 2009, 12:37:34 pm »

http://www.nadaka.us/ArmoGame2.asp

A java applet school project. Population evolution simulation in a 1 dimensional world. Its old, really old, I am not sure if it will still run properly in a modern jvm actually.
Logged
Take me out to the black, tell them I ain't comin' back...
I don't care cause I'm still free, you can't take the sky from me...

I turned myself into a monster, to fight against the monsters of the world.

Blacken

  • Bay Watcher
  • Orange Polar Bear
    • View Profile
Re: The Place For Any Programs You Wrote That Aren't Really Worthy Of Anything
« Reply #11 on: December 09, 2009, 06:33:13 pm »

Python is fun.

Code: [Select]
print ', '.join(map(str, sorted([int(raw_input('Number '+str(n+1)+'? ')) for n in range(int(raw_input('How many numbers? ')))])))(Everything is in one line)

First it asks how many numbers to take, and then it asks the numbers and finally prints them in sorted order.
I'm tempted to golf that, but my Perl is lacking. :/
Logged
"There's vermin fish, which fisherdwarves catch, and animal fish, which catch fisherdwarves." - Flame11235

Alexhans

  • Bay Watcher
  • This is toodamn shortto write something meaningful
    • View Profile
    • Osteopatia y Neurotonia
Re: The Place For Any Programs You Wrote That Aren't Really Worthy Of Anything
« Reply #12 on: December 10, 2009, 01:31:23 pm »

Give it 5 years, and Python will take over the Chinese government.
It will become self-aware, then write a program to control minds.
And that program will only be 8 trinary characters long.
John c++0xnnor will kick his ass and save the world!  ;D
Logged
“Eight years was awesome and I was famous and I was powerful" - George W. Bush.

Nivim

  • Bay Watcher
  • Has the asylum forgotten? Are they still the same?
    • View Profile
Re: The Place For Any Programs You Wrote That Aren't Really Worthy Of Anything
« Reply #13 on: December 11, 2009, 02:42:43 am »

 A long time ago I made an odd little game in visual basic that was utterly horrible, and boiled down to an attempt to use pieces of a calculator program for graphics. There was also a program to increase a person's typing speed made during this time.
 The next program was better (and in C++); it was an executive that displayed a would-be official looking error message. I meant to place it on my sisters computer, then direct all her shortcuts to it. The problem was I couldn't get the error message's title to stop being completely capitalized...I think I could go back and fix that now.
Logged
Imagine a cool peice of sky-blue and milk-white marble about 3cm by 2cm and by 0.5cm, containing a tiny 2mm malacolite crystal. Now imagine the miles of metamorphic rock it's embedded in that no pick or chisel will ever touch. Then, imagine that those miles will melt back into their mantle long before any telescope even refracts an image of their planet. The watchers will be so excited to have that image too.

qwertyuiopas

  • Bay Watcher
  • Photoshop is for elves who cannot use MSPaint.
    • View Profile
    • uristqwerty.ca, my current (barren) site.
Re: The Place For Any Programs You Wrote That Aren't Really Worthy Of Anything
« Reply #14 on: December 12, 2009, 01:52:33 pm »

Well, here is a program fragment, that avoids using the same code in two places, or splitting it into a function, or using a dreaded GOTO (Though there isn't much wrong with a goto, I just don't know the syntax, and it would be confusing anyway)
(This is from a WndProc's switch())
(I will get around to filling in the rest of the key handling eventually, but that doesn't concern you)
Code: [Select]
      case WM_KEYDOWN:
        if(wParam!=VK_ESCAPE)
        {
            break;
        }//if the key IS escape, it will fall through into WM_CLOSE
      case WM_CLOSE:
        wglMakeCurrent(NULL,NULL);
        wglDeleteContext(hRC);
        ReleaseDC(hwnd,hDC);
        PostQuitMessage(0);
        quit=1;
        break;
Logged
Eh?
Eh!
Pages: [1] 2 3