Hello Guest, please login or register.
Did you miss your activation email?
Login with username, password and session length.

Pages: [1]   Go Down

Author Topic: Silly or useless things you've coded  (Read 1836 times)

0 Members and 1 Guest are viewing this topic.
Silly or useless things you've coded
« on: October 01, 2010, 07:27:03 pm »
  • *
  • Reputation: +1/-0
  • Offline Offline
  • Gender: Male
  • Posts: 446
I haven't picked up Game Maker in a while, but there's really no excuse for this. I sat down today and said, "Alright, I need a script that will count out an amount of time before a key will be able to be re-pressed," and got to work.

Code: [Select]
/* timer()
Depends on: timer_set(seconds)

timer checks to see if the extra amount of time has passed by comparing
global.timeout to the current time. */

time = date_current_time();
if (time >= global.timeout) { return true; }
else { return false; }

Code: [Select]
/* timer_set(seconds)
Depends on: none

timer_set sets global.timeout as the current time with an amount in seconds added to it. */

var amount;
amount = argument0 * 0.00001182; //approximately one second

global.timeout = date_current_time() + amount;

Of course, right after that I remembered that alarms exist.

So basically, this is a topic for stupid coding stories. Let's hear 'em.
Logged
Re: Silly or useless things you've coded
« Reply #1 on: October 01, 2010, 07:53:07 pm »
  • *
  • Reputation: +2/-0
  • Offline Offline
  • Gender: Male
  • Posts: 1767
Nothing really silly about it, but I made this bank script because I was bored one day at school:
Code: [Select]
// First off, make sure the bank is not active
if (global.bank == 0)
{
    // Make the bank active and show the 3 options: Deposit, Withdraw, Leave.
    global.bank = 1;
    switch (show_message_ext("Welcome to the bank, what would you like to do?", "Deposit", "Withdraw", "Leave"))
    {
    case 1:
        // If Deposit is chosen, we'll get the amount of money we want to deposit.
        global.money_transaction = get_integer("You have " + string(global.money) + " money on hand. How much would you like to Deposit?", 0000);
        // Make sure the transaction isn't higher than the money you have in your pocket.
        if (global.money_transaction > global.money)
        {
            show_message("You do not have that much money.");
            global.bank = 0;
            exit;
        }
        // Also to make sure you're not putting in nothing, or negative numbers.
        else if (global.money_transaction < 1)
        {
            show_message("You're not depositing anything? Ok, come again soon.");
            global.bank = 0;
            exit;
        }
        // And if it all works out, we put the money in the bank, and subtract the amount from your pocket.
        else
        {
            global.money -= global.money_transaction;
            global.money_banked += global.money_transaction;
            show_message("You now have " + string(global.money_banked) + " money in the bank.");
            show_message("Thank you for visiting the bank.");
            global.bank = 0;
            exit;
        }
    break;
   
    case 2:
        // Pretty much the same as above, except we're taking money from the bank.
        global.money_transaction = get_integer("You have " + string(global.money_banked) + " money in the bank. How much would you like to Withdraw?", 0000);
        if (global.money_transaction > global.money_banked)
        {
            show_message("You do not have that much money in your bank account.");
            global.bank = 0;
            exit;
        }
        else if (global.money_transaction < 1)
        {
            show_message("You're not withdrawing anything? Ok, come again soon.");
            global.bank = 0;
            exit;
        }
        else
        {
            global.money += global.money_transaction;
            global.money_banked -= global.money_transaction;
            show_message("You now have " + string(global.money_banked) + " money in the bank.");
            show_message("Thank you for visiting the bank.");
            global.bank = 0;
            exit;
        }
    break;
   
    case 3:
        // Choosing to leave, so we end our bank script.
        global.bank = 0;
        exit;
    break;
    }
}

I also made this RIN Cheat Editor which is a simple program to create .cht files for use with the RIN Gameboy Emulator for the PSP.
http://www.zfgc.com/index.php#?action=games&sa=view&id=133
Logged
  • https://colbydude.com

Mamoruanime

@Mamoruanime
Re: Silly or useless things you've coded
« Reply #2 on: October 02, 2010, 03:36:12 am »
  • ^Not actually me.
  • *
  • Reputation: +9/-0
  • Offline Offline
  • Gender: Male
  • Posts: 9786
I can't really say it's useless, but I once coded a program that would finish out my equations and "show the work" so I could cheat on my tests at school.

I figured that in itself deserved an A.
Logged

Mirby

Drifter
Re: Silly or useless things you've coded
« Reply #3 on: October 02, 2010, 03:47:17 am »
  • To bomb or not to bomb...
  • *
  • Reputation: +6/-0
  • Offline Offline
  • Gender: Female
  • Posts: 4162
It is kinda silly though... :P
Logged

Mirby Studios | Share & Enjoy now available! (Links above!) | Games I've Beaten
Quote from: Mamoruanime
I like-like it :D
  • Mirby Studios
Re: Silly or useless things you've coded
« Reply #4 on: October 02, 2010, 02:51:52 pm »
  • *
  • Reputation: +2/-0
  • Offline Offline
  • Gender: Male
  • Posts: 1767
I can't really say it's useless, but I once coded a program that would finish out my equations and "show the work" so I could cheat on my tests at school.

I figured that in itself deserved an A.

Ah that also reminds me. I made a program that does that for quadratic formula related problems. And it worked beautifully.
Logged
  • https://colbydude.com
Re: Silly or useless things you've coded
« Reply #5 on: October 02, 2010, 03:34:45 pm »
  • (y)(;>.<;)(y)
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 3293
A program that goes full-screen, completely disables the keyboard and prints to the screen:
Keyboard not found.
Press any key to continue.
Logged

Xiphirx

wat
Re: Silly or useless things you've coded
« Reply #6 on: October 02, 2010, 09:31:22 pm »
  • Xiphirx
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 3007
The matrix effect for PSP.

Well, It was one of my first applications for the PSP lol, I was just dicking around.
Logged
  • For The Swarm
Re: Silly or useless things you've coded
« Reply #7 on: October 03, 2010, 07:20:40 am »
  • *
  • Reputation: +9/-0
  • Offline Offline
  • Gender: Male
  • Posts: 3725
A java application that generated a StackOverFlowError. It would continuously add an integer to a vector, print that integer and index to the console. This would continue until a StackOverFlowError was generated. I just wanted to see if I could.
Logged
Pages: [1]   Go Up

 


Contact Us | Legal | Advertise Here
2013 © ZFGC, All Rights Reserved



Page created in 0.235 seconds with 54 queries.