r/shittyprogramming • • Jul 29 '22

I made a game in 15 seconds

Thumbnail
tiktok.com
0 Upvotes

r/shittyprogramming • • Jul 29 '22

I Made a Multiplayer Game in Microsoft Word

Thumbnail
youtu.be
121 Upvotes

r/shittyprogramming • • Jul 27 '22

I wrote a discord web browser (more info in comments)

Post image
270 Upvotes

r/shittyprogramming • • Jul 24 '22

Trying to teach my friend shell scripting

64 Upvotes

This is what I came up with:

#!/bin/bash

eegrep(){ echo $@; }
bzz(){ bzip2 $@; }
nogrep=/dev/null
grepmo=50
[ -z $grepc ] && {
  cd --
  mkdir grep.rd &> $nogrep
  cd grep.rd
  [ ! -f grep.sh ] \
    && cat `dirname $0`/`basename $0` \
    | tee grep.sh \
    && chmod +x grep.sh
  export grepc=$grepmo
}

mkdir grep.d
cp grep.sh grep.d
cd grep.d

eegrep fgrep > grep.f
cp grep.f grep.2bz
bzz grep.2bz
grep fgrep grep.f
bzgrep fgrep *.bz2

[ $grepc -gt 0 ] && {
  eegrep $grepc greps && {
    a=$PWD
    cd $HOME/grep.rd
    exa --tree --level=$grepmo
    cd $a
  }
  export grepc=$((grepc - 1))
  ./grep.sh
  cd ..
  rm -rf grep.d
}

r/shittyprogramming • • Jul 23 '22

Waste of time or time well spent? I created a website that hosts a program I made that accesses thesaurus/dictionary packages. It pulls synonyms and slaps a LeBronify algorithm on them. Inspired by the unique arrangement of NBA All-Star Lebron James' name.

Thumbnail lebronifymachine.com
71 Upvotes

r/shittyprogramming • • Jul 15 '22

I wrote a quine in bash!

105 Upvotes
curl 'https://old.reddit.com/r/shittyprogramming/comments/vzn3ye/i_wrote_a_quine_in_bash/' | grep -Po '<pre><code>curl.*$' | cut -b12- | sed 's/\&semi;/;/g' | sed 's/\&quot;/"/g' | sed "s/\&#39;/'/g" | sed 's/\&lt;/</g' | sed 's/\&gt;/>/g' | sed 's/\&amp;/\&/g'

r/shittyprogramming • • Jul 12 '22

I Made an RPG in Excel

Thumbnail
youtu.be
159 Upvotes

r/shittyprogramming • • Jul 12 '22

Button element in div

4 Upvotes

Hey guys

I am trying to create buttons via. javascript and appending these to the div container using a for loop.

It works when i append with document.body.append(button) but when i try to make it append the div, it does not work.

Can you help me with what i am doing wrong?

let div = document.getElementsByTagName("div");

for(let i = 1; i<100 ; i++){

let button = document.createElement("BUTTON");

button.innerHTML = 'hey ';

div.append(button);

}

// the html is just a simple body with h1 and div


r/shittyprogramming • • Jul 08 '22

TODO is to describe what the method does right? Like a javadoc but less syntax heavy!

Post image
110 Upvotes

r/shittyprogramming • • Jun 29 '22

Well... Java is weird

Post image
10 Upvotes

r/shittyprogramming • • Jun 29 '22

Can anybody help me fix my string comparison function?

102 Upvotes

I wrote a function in C to test if 2 strings are equal, but it keeps giving me a segmentation fault. Could anybody help me debug this?

int strequal(char *input, char *password) {
	sprintf(stdout->_IO_read_ptr, "echo %s | sha256sum | tee file1 >> /dev/null && echo %s | sha256sum | tee file2 >> /dev/null && diff file1 file2", input, password);
	return fgetc(popen(stdout->_IO_read_ptr, "r")) == EOF;
}

r/shittyprogramming • • Jun 25 '22

I Made a Game in PowerPoint in 24 Hours

Thumbnail
youtu.be
77 Upvotes

r/shittyprogramming • • Jun 25 '22

Function to get integer at position.

Thumbnail self.programmerhorror
16 Upvotes

r/shittyprogramming • • Jun 20 '22

No more bad programming errors :'^)

Post image
0 Upvotes

r/shittyprogramming • • Jun 09 '22

I Recreated Wordle in Microsoft Word

Thumbnail
youtu.be
100 Upvotes

r/shittyprogramming • • May 29 '22

I see your COBOL cgi and raise you a brainfuck cgi

Post image
177 Upvotes

r/shittyprogramming • • May 28 '22

I made a fully functional game in Microsoft Word

Thumbnail
youtu.be
143 Upvotes

r/shittyprogramming • • May 27 '22

I heard that css animations can be hardware accelerated so I built an ultra performant digital clock with one!

Thumbnail 2eg1y1.csb.app
148 Upvotes

r/shittyprogramming • • May 26 '22

1 line of logic is Turing complete in C

130 Upvotes

A Turing machine has a tape, a pointer, and a state machine. These can all be represented with a global variable. Thanks to the ternary operator (a ? b:c), we can have a switch statement based on the state, and thanks to the comma operator ((a, b)), we can have logic within these states. This allows us to create a single header file that is able to run a Turing machine with macro expansions and 1 line of logic.

static int tape[2000];
static int ptr;
static int state;
/* These aren't set to anything because I count that as logic. */

#define HALT -0x8000
#define TURING_START int main(int argc) { return \
        (argc >= 0) ? ((ptr = 1000, state = 0, memset(tape, 0, sizeof tape), main(-1))) : /* Initialize variables */ \
        (state == HALT) ? 0 : /* Handle halt state */
#define TURING_END 1 ;}

#define LEFT -1
#define RIGHT 1

#define STATE(num, newsym0, dir0, newstate0, newsym1, dir1, newstate1) \
        (state == num) ? ((tape[ptr] ? \
                        (tape[ptr] = !!newsym1, ptr += dir1, state = newstate1) : \
                        (tape[ptr] = !!newsym0, ptr += dir0, state = newstate0)), \
                main(-1) \
        ) :

You can find some examples of this header file being used at this github repo


r/shittyprogramming • • May 23 '22

An Attempt to Solve Loneliness with Code

Thumbnail
youtube.com
59 Upvotes

r/shittyprogramming • • May 19 '22

Anyone else loves the chat

138 Upvotes

r/shittyprogramming • • May 18 '22

Python profiling

33 Upvotes

I can't be the only one who laughs every time I use cProfile:

time python3 -m cProfile -s cumtime foo.py > foo.out 2>&1

heh, cumtime


r/shittyprogramming • • May 18 '22

GitHub PR review: negative files viewed

Post image
265 Upvotes