Useless Scripts/Programs

To quote a famous American Noble Prize Winner, yes, we can. We've had arbitrary precision calculators for a for a long time.
sh:
$ bc
1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000+1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
20000000000000000000000000000000000000000000000000000000000000000000\
00000000000000000000000000000000000000000000000000000000000
but, then https://cplusplus.com/reference/climits/

And i also have algorithms to calculate large numbers, which will not require permission to use it in my own projects, so not useless.
 
That's pretty funny :-).

John Walker, who famously started Autodesk (author of AutoCad), wrote a book called the hackers diet https://www.fourmilab.ch/hackdiet/ . His own personal lament, given in the forward to the book, was along the lines of "I've set up a multi-million dollar software company, I've made a personal fortune from it, I'm living the life of a multi-millionaire... so how come I can't 'hack' my own weight?". As an engineer, he theorised that there was a broken control mechanism that would normally regulate a negative feedback loop somewhere in the system. The book was based on the traditional methods of calorie counting, weight tracking and exercise.

John wrote that book before all the latest research of the last 10-15 years (from guys like Robert Lustig) was published, revealing the metabolic role of dietary sugar and UPF, and the link to a large number of related diseases. We now know a lot more about how the system really works.
 
something not so 'useless' but nonetheless still 'useless'.
I made a program to jumble text and I used Ai to help me write it. I added the daemon, sock, poison string injections, string tokenization (and probably a bit more--but that doesn't matter) code, while Ai built a bunch of stuff like: file blocking, token jumbling stuff, etc..

Code:
/**
 * BRIEF
 * Chunked, pattern-directed text jumbler for array-of-arrays tokenized input.
 * 
 * USAGE
 * pipe json string and use nc(1) to write/read sock for output.
 * 
 * JSON:
 *  file:<input-file> 
 *  chunk_size:[chunk_size] 
 *  pattern:[pattern_string]
 *  token_shuffle_prob:[token_shuffle_prob]
 * 
 * where:
 *  - chunk_size: positive integer (default 4)
 *  - pattern_string: sequence of 'F' (forward) and 'R' (reverse),
 *    e.g. "FRRF" (default "FR")
 *  - token_shuffle_prob: float in [0,1], probability to shuffle
 *    tokens inside a unit (default 0.0)
 * 
 * TEST
 *  printf '{"file":"war.txt","chunk_size":"4","pattern":"RF","token_shuffle_prob":"0.5"}\n' | nc -U ./jumble.sock
 */
 
Correct. Sorry, probably can't post the whole source. I just commented out 300+ lines of code but this thing is about 1500 lines of code now (I'm wrangling in this ai sloppy stuff). ...also, does anyone know Ai stop codes off the top of their head? :)
 
Would a useless game be possible? It can't have a clear goal or some kind of victory. The graphics and music must be so abstract that it doesn't add anything.
The gameplay must be absolute nihilist. Doing anything else like passive screen staring is less useless... Maybe let the player try to solve a faulty sudoku that's not possible. Also add online competition charts but the scores can't be based on anything. 😆
 
MG i just spent almost an entire night coding a useless game, it's a shooter style one where all you do is shoot the screen until you fill the top row of the game screen with lodged bullets, it doesn't even reward you or anything, it just keeps running

shoot.h:
C:
#include <curses.h>

typedef struct SPRITE {
    int h, w;
    const char* skin;
} SPRITE;

extern WINDOW* game;

extern WINDOW* create_win(int h, int w, int y, int x);
extern WINDOW* genspr(const char* skin, int h, int w, int y, int x);
extern void movespr(WINDOW* spr, const char* skin, int y, int x);
extern void shoot(int y, int x, int hit);

shoot.c:
C:
#include <unistd.h>
#include "shoot.h"

WINDOW* game;

typedef struct SPRITE {
    int h, w;
    const char* skin;
} SPRITE;

WINDOW* create_win(int h, int w, int y, int x) {
    WINDOW* win;
    win = newwin(h, w, y, x);
    box(win, 0, 0);
    wrefresh(win);

    return win;
}

WINDOW* genspr(const char* skin, int h, int w, int y, int x) {
    WINDOW* spr;
    spr = derwin(game, h, w, y, x);
    wprintw(spr, "%s", skin);
    wrefresh(spr);

    return spr;
}

void movespr(WINDOW* spr, const char* skin, int y, int x) {
    werase(spr);
    touchwin(game);
    wnoutrefresh(spr);
    mvderwin(spr, y, x);

    wprintw(spr, "%s", skin);
    wnoutrefresh(spr);
    doupdate();
}

void shoot(int y, int x, int hit) {
    SPRITE bullet = {
        .skin = "*",
        .h = 1,
        .w = 1
    };

    WINDOW* bullet_w = genspr(bullet.skin, bullet.h, bullet.w, y, x);
    for (; y >= hit; --y) {
        wmove(game, y, x);
        movespr(bullet_w, bullet.skin, y, x);
        wrefresh(game);
        usleep(5000);
    }
}

main.c:
C:
#include <fcntl.h>
#include "shoot.h"

int main() {
    fcntl(0, F_SETFL, O_NONBLOCK);

    initscr();
    noecho();
    curs_set(0);

    cbreak();

    int ymax = 0;
    int xmax = 0;

    getmaxyx(stdscr, ymax, xmax);

    game = create_win(50, 80, (ymax-50)/2, (xmax-80)/2);
    keypad(game, TRUE);

    int posy = 45;
    int posx = 75/2;

    SPRITE player = {
        .skin = "-=^=-",
        .h = 1,
        .w = 5
    };
    WINDOW* player_w = genspr(player.skin, player.h, player.w, posy, posx);

    int key = 0;
    while ((key = wgetch(game)) != 'q') {
        switch(key) {
            case KEY_UP:
            case 'k':
                if (posy >= 2) movespr(player_w, player.skin, --posy, posx);
                break;

            case KEY_DOWN:
            case 'j':
                if (posy <= 47) movespr(player_w, player.skin, ++posy, posx);
                break;

            case KEY_LEFT:
            case 'h':
                if (posx >= 2) movespr(player_w, player.skin, posy, --posx);
                break;

            case KEY_RIGHT:
            case 'l':
                if (posx <= 73) movespr(player_w, player.skin, posy, ++posx);
                break;

            case 'z':
                shoot(posy-1, posx+2, 1);
                break;
        }
    }

    endwin();
    return 0;
}

for the cherry on top, if you run this you'll realize there's a bug when exiting where it can't restore the terminal state properly for some reason, i have no idea why it happens but it started happening after i added that wrefresh(game) line under the for loop in shoot() (and that line is required for making the animation of the bullet being shot xp)

EDIT: further testing shows that the bug actually happens if you quit the game after shooting at least once, so there must be something wrong with the way i made it do the shooting animation here (it was hacky all from the beginning anyway, i'm new to this shit)
 
cool, i've actually been trying to evolve this into an actual game, but i can't for the life of me figure out how to implement a collision system so that you can actually shoot and kill enemies! and don't even get me started in programming the enemy's movements!
 
cool, i've actually been trying to evolve this into an actual game, but i can't for the life of me figure out how to implement a collision system so that you can actually shoot and kill enemies! and don't even get me started in programming the enemy's movements!
oooh when we were 16 we had a collision system in an ncurses app but it was really dogshit brute force code and idk if we have it anymore
 
i can't even make a "dogshit brute force code" for that, everything i try either results in it half-working or working but throwing a SEGFAULT when you hit the shoot key again

EDIT: as for coding the enemy's movements, i guess it'd be easier if i just made it move with the WASD keys and leave player 1 with the arrow/vim keys, making it even a 2-player game, that i can't really play because i have no friends
 
16?! wow. that's impressive (the extent of my computer usage at 16 was "typing tutor"). err, um, I mean...yeah, I'm pretty sure any 'collision system' I was working on at 16 (with a girl from class) was also dogshit so, yeah, I'm bad at them too. sorry, I can't help either, ruby R53.

On an entirely different note though, you guys mind if I take a break from "helping you other smart people"? I mean: you guys are smart, too, you got this part, right?


Not sure if I'd agree with that last part; seems like you have a whole forum full of them.
 
sorry, I can't help either, ruby R53.
don't worry, either i'll give up on this entirely or ask for help on a more dedicated forum or i'll feel a spiritual connection with the creators of ncurses to magically get my solution : )

you guys mind if I take a break from "helping you other smart people"? I mean: you guys are smart, too, you got this part, right?
i don't, tho' i wouldn't say i'm exactly "smart" lol

Not sure if I'd agree with that last part; seems like you have a whole forum full of them.
aw thanks :' )
 
don't worry, either i'll give up on this entirely or ask for help on a more dedicated forum or i'll feel a spiritual connection with the creators of ncurses to magically get my solution : )


i don't, tho' i wouldn't say i'm exactly "smart" lol


aw thanks :' )
Smarter than me I. However, glad you believe my extremely convincing stance that I am smart as you guys though (I was a bit nervous for a minute there).

I can start googling "game design collision system" but I'll be super far behind. I have a few things to finish first but I'll start reading tonight (might be fun).
 
Smarter than me I. However, glad you believe my extremely convincing stance that I am smart as you guys though (I was a bit nervous for a minute there).
heh we're chiller than that twin (at least i am)

I can start googling "game design collision system" but I'll be super far behind. I have a few things to finish first but I'll start reading tonight (might be fun).
meh, i did try the same but specifically wording it for ncurses and couldn't find anything meaningful (the search lasted for 30 seconds), ncurses is probably not very suitable for game development despite its features (maybe not this kind of game i'm trying to make but still)
 
no need to mog us 🥀✌️
to us mog is
1776811984409.png
idk sense youre using it in
 
Back
Top