Software that's like a customized Magic 8-Ball?

Charizard632

Now a great Touhou addict
  • 105
    Posts
    15
    Years
    • Age 29
    • Seen Jul 6, 2012
    I'm stuck on something, and I need help. I wanted a program in which you can a custom answer, and use it like a Magic 8 Ball. These kinds of programs help me a lot, and I'm stuck. Can you help me find a decent program? I'm using the latest version of Windows, by the way.
     
    I made something like this a few years ago, it's actually one of the easiest programs you could make. Just make an input stream, a random variable, and do a check that spits out an output given the random variable.
     
    Thank you, twocows! Can you please give me the download link/name of program?
     
    Thank you, twocows! Can you please give me the download link/name of program?

    If you want, I could make somehing like that for you real quick. Send me a PM if you're interested.
     
    I wrote this up really fast. The executable and this source is attached, you can modify it however you want, I only included a few responses myself.

    Code:
    #include <stdio.h>
    #include <stdlib.h>
    #include <string.h>
    #include <time.h>
    
    int main()
    {
        srand(time(NULL));
        
        int numberOfResponses = 4;
        int random = ((int) rand())%numberOfResponses;
        char answer[255] = { 0 };
        
        puts("Please enter a question.");
        fgets(answer, sizeof answer, stdin);
        printf("Your question was \"%s\" My response: ", strtok(answer, "\n"));
        if(random == 0)
            puts("Yes, it seems certain.");
        if(random == 1)
            puts("No, it is impossible.");
        if(random == 2)
            puts("It is unlikely.");
        if(random == 3)
            puts("The outcome is uncertain.");
        puts("Please press enter to exit.");
        fgets(answer, sizeof answer, stdin);
    }
     
    I wrote this up really fast. The executable and this source is attached, you can modify it however you want, I only included a few responses myself.

    Code:
    #include <stdio.h>
    #include <stdlib.h>
    #include <string.h>
    #include <time.h>
     
    int main()
    {
        srand(time(NULL));
     
        int numberOfResponses = 4;
        int random = ((int) rand())%numberOfResponses;
        char answer[255] = { 0 };
     
        puts("Please enter a question.");
        fgets(answer, sizeof answer, stdin);
        printf("Your question was \"%s\" My response: ", strtok(answer, "\n"));
        if(random == 0)
            puts("Yes, it seems certain.");
        if(random == 1)
            puts("No, it is impossible.");
        if(random == 2)
            puts("It is unlikely.");
        if(random == 3)
            puts("The outcome is uncertain.");
        puts("Please press enter to exit.");
        fgets(answer, sizeof answer, stdin);
    }
    Sorry. This isn't what I had in mind. What I ment is you can change the answers. I tried, and it failed. I wanted more choices.
     
    Sorry. This isn't what I had in mind. What I ment is you can change the answers. I tried, and it failed. I wanted more choices.
    Oh, well you didn't say that. If I get bored, I might recompile it to read from a text file for the number of answers, but that's a bit more time consuming and I have other things to do.
     
    Sorry. This isn't what I had in mind. What I ment is you can change the answers. I tried, and it failed. I wanted more choices.
    Made a nice little interface for you. Download it at https://www.wakachamo.com/8ball.exe.zip

    Hope twocows doesn't mind me basically ripping off the idea of making a program out of this. :P

    Note that it has no included answers. You need to click on 'Edit Answers' and add in your own to begin.

    This was done in about 20 minutes seeing as you sent me a PM suggesting the fact that you were in quite a hurry of getting something like this.

    Note that your answers are saved on a text file called "8-ball Answers.txt" in your Documents folder.

    As mentioned before, this was done in a bit of a hurry so if you find anything that doesn't go as expected, be sure to tell me.
     
    Last edited by a moderator:
    Thank you very much, wakachamo!

    Suggested Improvements: Make the answer text bigger, if you can.
    Try to animate the answer text when I select Generate Answer
    Make a thing where each answer has its own color, and you can even change it.
     
    Back
    Top