The Programmatic Thread (Reply With Code!)

Cottontail

♫ Don't Worry, Be Hoppy! ♫
Est. Contributor
Messages
7,346
Role
  1. Adult Baby
  2. Diaper Lover
  3. Babyfur
  4. Diaperfur
  5. Sissy
  6. Little
I tried to get one of these going in the Programmers group on the old forum, but the groups never got much action. I'd forgotten about it until a week ago when I stumbled upon a coded message on somebody's user profile. I can never resist that stuff, and had to sit there and figure it out.

Anyway! Here's how this thread works:
  1. Decide on a short message. It can be a reply to a previous message, but that's not strictly required.
  2. Create (by whatever means) a short program that prints your message. The message should not be obvious from a glance at the program. Additionally, it must be possible to run your program on codepad.org, so please test it there before posting!
  3. Post your program here (using CODE tags!), along with some indication of what language it's written in.
Some other suggestions:
  • Consider keeping your messages (and programs) short and sweet. These should be fun little things, not big ugly multi-page behemoths.
  • Consider putting your user name in your messages. That establishes a basic level of originality.
  • Review codepad.org's language support here. Newer elements of your favorite programming language(s) may not be available.
Have fun!

Python:
import sys
message = [
  "dIaPers", "biNKiEs", "onEsiES", "boTTLes", "huGgies", "paMpeRs", "naPPiEs",
  "PuLLUPS", "diaPeRS", "biNkies", "OnESIES", "botTlES", "huGgIES", "paMPeRs",
  "NaPPIES", "pUlLUPS", "diaPErS", "biNkies", "onESies", "botTLeS", "huGGIEs",
  "paMpeRs", "naPpiEs", "puLLUPs", "diaPeRS", "biNkIEs", "onESIes", "BoTTLES",
  "hUgGiES", "paMpERS", "napPIeS", "puLLuPs", "diAPERs", "biNKiES", "OnESIEs",
  "BOTtLeS", "huggieS", "pAMPErs", "naPpies", "pulLuPS", "diaPeRS", "biNkies",
  "onEsieS", "botTlES", "huGGIEs", "paMpERs", "naPpiES", "PULlUpS", "DIAPERS"
  ]
for word in message:
  symbol = 0
  mask = 0x40
  for letter in word:
    if ord(letter) & 0x20:
      symbol |= mask
    mask >>= 1
  sys.stdout.write(chr(symbol))
 
  • Like
Reactions: WillFord384, ElPulpo, perlFerret and 1 other person
System.out.println( "No Java :-(" );
 
  • Sad
  • Like
Reactions: WanderingToddler and Cottontail
Code:
<?php
$array =array(32,33,45);
$valid = array(0,0,0,0,0,0,0,0,1,0,
0,0,0,0,0,0,0,0,0,1,
0,0,1,0,0,0,0,0,0,0,
0,0,1,0,0,1,1,0,1,0,
1,0,0,1,0,1,1,1,0,1,
1,0,0,1,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,
0,0);
$final = "";
$indexes =array(3,0,11,13,17,8,0,7,10,6,14,8,15,16,1,0,2,5,6,12,7,8,15,10,12,9,4,13,7,7,11,8,15 );
for($x = 65; $x<123; $x++){
    if($valid[$x-65]== 1){
    array_push($array, $x);
    }
}
foreach($indexes as $index){
    $final .= chr($array[$index]);
}

print($final);
?>

This was difficult. I have not used any of the allowed languages in a long time. I had to brush off my php.
 
  • Like
Reactions: perlFerret, Cottontail and KitsuneFox
It’s been too long since I have coded to do this
 
I ought to have mentioned above: For any code-muggles wanting to follow along, all you need to do is copy the code, paste it into the text box on codepad.org, choose the language, and click Submit. It's almost easier than using Google Translate.

CPDude said:
It’s been too long since I have coded to do this
PHP:
<?php echo base64_decode("Tm8gNjUwMiBhc3NlbWJseSBvcHRpb24/IDpQIDopCn5Db3R0b250YWlsCg==");?>

WanderingToddler said:
C:
#include <stdio.h>
#define p (i++,(d[i/6]-32)>>(i%6)&1)

int main(int c, char* v[])
{
  int i = -1;

  const char* d =
    "<-MLGB2<93,XGFN3N0#!^]PP2(2\">NS4Q8YWU0MRCO&;O8BSUTL4WSOFF7VYY;K"
    "J4O\\L7I2\\1T7-A<:8_1^[*.E2Q:(/1##%9@YWC3/%#CW[\"L\\L7)Y=<=O:6?D"
    "G_\"[G59+<SA &)KFG>:W=\"7'U]0>7Q[=!F+_9KDGB2\\.^$X[^*F0-$'ONJ?V["
    "Z>8[[>>; ,XGO2EX%1)D'CWQCN\"_9^P-8MG+<N[FCNCANJ;N#";

  while (putchar(
    p?p?p?32:p?p?105:p?p?119:39:46:p?115:110:p?p?116:p?104:p?118:109:p
    ?p?p?102:73:108:111:p?p?p?p?114:p?p?p?126:106:p?89:87:p?p?68:45:p?
    44:0:p?p?p?121:107:p?99:84:p?p?67:33:103:p?p?p?98:62:117:100:p?p?p
    ?10:112:97:101
    ));

  return 0;
}
 
Last edited:
  • Like
Reactions: perlFerret
Python:
# Python 3.9
x = "7332767375693284793287696582326873658069828333";
y = "";

def a(aa):
    return (chr(int(aa)));

for i in range (0,len(x),2):
    y += a((x[i:i+2]));

print (y);
 
Last edited:
  • Like
Reactions: Cottontail and perlFerret
This is the most convoluted way I could think of to do it in Python 3
Python:
# Python 3.9

import turtle;
turtle.bgcolor("white");
Pen = turtle;
Pen.up();
def gt(q,w):
    Pen.goto(q,w);
def dn():
    Pen.down();
def up():
    Pen.up();
def hm():
    Pen.home();
def nr():
    Pen.rt(90);
def nl():
    Pen.lt(90);
def ff():
    dn();
    Pen.fd(30);
    up();
def hf():
    dn();
    Pen.fd(15);
    up();
def fb():
    dn();
    Pen.bk(30);
    up();
def hb():
    dn();
    Pen.bk(15);
    up();
def one():
    dn();
    ff();
    up();
def two():
    dn();
    nr();
    ff();
    nl();
    up();
def three():
    one();
    hb();
    two();
    hb();
    one();
def four():
    one();
    fb();
    two();
    nl();
    hf();
    nr();
    one();
    fb();
    nr();
    hf();
    nl();
    one();
def five():
    two();
    nl();
    ff();
    nr();
    dn();
    hf();
    nr();
    hf();
    nr();
    hf();
    up();
    nr();
    nr();
def six():
    nr();
    Pen.fd(15);
    dn();
    Pen.rt(-45);
    Pen.fd(22);
    up();
    Pen.rt(-45);
def seven():
    nr();
    hf();
    dn();
    Pen.lt(135);
    Pen.fd(22);
    up();
    Pen.rt(45);

gt(-250,250);
three();
gt(-170,250);
two();
one();
gt(-130,250);
three();
gt(-90,250);
two();
gt(-90,250);
six();
gt(-90,250);
seven();
gt(-60,250);
four();
gt(-240,210);
two();
gt(-240,225);
six();
gt(-240,195);
seven();
gt(-210,210);
three();
gt(-170,210);
two();
gt(-140,210);
two();
gt(-170,200);
one();
gt(-170,210);
one();
gt(-130,210);
five();
gt(-100,210);
four();
gt(-60,210);
five();
gt(-60,210);
six();
gt(-30,210);
one();
gt(-30,210);
nr();
hf();
nl();
ff();
nr();
hf();
nr();
ff();
hm();
 
  • Like
Reactions: Cottontail
KitsuneFox said:
import turtle;
Ha ha, WHAT?! Codepad.org supports graphics?!

Well, you get a demerit for shamelessly breaking Rule 2, but if you're going to do that, may as well do it BIG! :)

(Runs fine on macOS 11.4, though.)

But please, no Tcl/Tk, OpenGL, or anything that requires DOS4GW.EXE.
 
Turtle is a native library in Python.
I haven’t used it in a long time 🤪
 
Last edited:
KitsuneFox said:
I haven’t used it in a long time 🤪
My first and only time using it, when it was popularly called "Logo," was in middle school in the 80's. On Apple II's and Franklin Ace 1000's. (Mostly the latter.) Those Ace 1000's... The disk drives would make angry burping and farting noises when they couldn't read a disk. The old computer teacher would walk over and smack them with his hand, which surprisingly seemed to "fix" them most of the time. Ah! The good ol' days. :)
 
Last edited:
  • Like
  • Wow
Reactions: perlFerret and KitsuneFox
int main() {
char* wearing = "diaper";
sprintf(wearing + 6, "damnit not again");
return 0;
}
 
console.log("No Javascipt 🙁")
 
Cottontail said:
My first and only time using it, when it was popularly called "Logo," was in middle school in the 80's. On Apple II's and Franklin Ace 1000's. (Mostly the latter.) Those Ace 1000's... The disk drives would make angry burping and farting noises when they couldn't read a disk. The old computer teacher would walk over and smack them with his hand, which surprisingly seemed to "fix" them most of the time. Ah! The good ol' days. :)
Logo was the first language I learned on C64, followed by BASIC.
 
All the cool kids are coding in Rust. :)
 
Here is something I came up with in HTML ...
.
HTML:
<!DOCTYPE html>
<html>
<head>
    <style>
        .x {background-color:black; position:absolute; width:10px;height:10px;}
    </style>
</head>
<body>
<div style="background-color:white; width:280px; height:120px">
        <div class="x"; style="top:10px; left:10px; "> </div>
        <div class="x"; style="top:10px; left:20px; "> </div>
        <div class="x"; style="top:10px; left:30px; "> </div>
        <div class="x"; style="top:10px; left:50px; "> </div>
        <div class="x"; style="top:10px; left:90px; "> </div>
        <div class="x"; style="top:10px; left:100px; "> </div>
        <div class="x"; style="top:10px; left:110px; "> </div>
        <div class="x"; style="top:10px; left:130px; "> </div>
        <div class="x"; style="top:10px; left:160px; "> </div>
        <div class="x"; style="top:10px; left:180px; "> </div>
        <div class="x"; style="top:10px; left:190px; "> </div>
        <div class="x"; style="top:10px; left:200px; "> </div>
        <div class="x"; style="top:20px; left:20px; "> </div>
        <div class="x"; style="top:20px; left:50px; "> </div>
        <div class="x"; style="top:20px; left:100px; "> </div>
        <div class="x"; style="top:20px; left:130px; "> </div>
        <div class="x"; style="top:20px; left:150px; "> </div>
        <div class="x"; style="top:20px; left:180px; "> </div>
        <div class="x"; style="top:30px; left:20px; "> </div>
        <div class="x"; style="top:30px; left:50px; "> </div>
        <div class="x"; style="top:30px; left:100px; "> </div>
        <div class="x"; style="top:30px; left:130px; "> </div>
        <div class="x"; style="top:30px; left:140px; "> </div>
        <div class="x"; style="top:30px; left:180px; "> </div>
        <div class="x"; style="top:30px; left:190px; "> </div>
        <div class="x"; style="top:40px; left:20px; "> </div>
        <div class="x"; style="top:40px; left:50px; "> </div>
        <div class="x"; style="top:40px; left:100px; "> </div>
        <div class="x"; style="top:40px; left:130px; "> </div>
        <div class="x"; style="top:40px; left:150px; "> </div>
        <div class="x"; style="top:40px; left:180px; "> </div>
        <div class="x"; style="top:50px; left:10px; "> </div>
        <div class="x"; style="top:50px; left:20px; "> </div>
        <div class="x"; style="top:50px; left:30px; "> </div>
        <div class="x"; style="top:50px; left:50px; "> </div>
        <div class="x"; style="top:50px; left:60px; "> </div>
        <div class="x"; style="top:50px; left:70px; "> </div>
        <div class="x"; style="top:50px; left:90px; "> </div>
        <div class="x"; style="top:50px; left:100px; "> </div>
        <div class="x"; style="top:50px; left:110px; "> </div>
        <div class="x"; style="top:50px; left:130px; "> </div>
        <div class="x"; style="top:50px; left:160px; "> </div>
        <div class="x"; style="top:50px; left:180px; "> </div>
        <div class="x"; style="top:50px; left:190px; "> </div>
        <div class="x"; style="top:50px; left:200px; "> </div>
        <div class="x"; style="top:70px; left:10px; "> </div>
        <div class="x"; style="top:70px; left:20px; "> </div>
        <div class="x"; style="top:70px; left:50px; "> </div>
        <div class="x"; style="top:70px; left:60px; "> </div>
        <div class="x"; style="top:70px; left:70px; "> </div>
        <div class="x"; style="top:70px; left:100px; "> </div>
        <div class="x"; style="top:70px; left:130px; "> </div>
        <div class="x"; style="top:70px; left:140px; "> </div>
        <div class="x"; style="top:70px; left:150px; "> </div>
        <div class="x"; style="top:70px; left:170px; "> </div>
        <div class="x"; style="top:70px; left:180px; "> </div>
        <div class="x"; style="top:70px; left:190px; "> </div>
        <div class="x"; style="top:70px; left:210px; "> </div>
        <div class="x"; style="top:70px; left:220px; "> </div>
        <div class="x"; style="top:70px; left:230px; "> </div>
        <div class="x"; style="top:70px; left:250px; "> </div>
        <div class="x"; style="top:70px; left:260px; "> </div>
        <div class="x"; style="top:70px; left:270px; "> </div>
        <div class="x"; style="top:80px; left:10px; "> </div>
        <div class="x"; style="top:80px; left:30px; "> </div>
        <div class="x"; style="top:80px; left:60px; "> </div>
        <div class="x"; style="top:80px; left:90px; "> </div>
        <div class="x"; style="top:80px; left:110px; "> </div>
        <div class="x"; style="top:80px; left:130px; "> </div>
        <div class="x"; style="top:80px; left:150px; "> </div>
        <div class="x"; style="top:80px; left:170px; "> </div>
        <div class="x"; style="top:80px; left:210px; "> </div>
        <div class="x"; style="top:80px; left:230px; "> </div>
        <div class="x"; style="top:80px; left:250px; "> </div>
        <div class="x"; style="top:90px; left:10px; "> </div>
        <div class="x"; style="top:90px; left:30px; "> </div>
        <div class="x"; style="top:90px; left:60px; "> </div>
        <div class="x"; style="top:90px; left:90px; "> </div>
        <div class="x"; style="top:90px; left:100px; "> </div>
        <div class="x"; style="top:90px; left:110px; "> </div>
        <div class="x"; style="top:90px; left:130px; "> </div>
        <div class="x"; style="top:90px; left:140px; "> </div>
        <div class="x"; style="top:90px; left:150px; "> </div>
        <div class="x"; style="top:90px; left:170px; "> </div>
        <div class="x"; style="top:90px; left:180px; "> </div>
        <div class="x"; style="top:90px; left:210px; "> </div>
        <div class="x"; style="top:90px; left:220px; "> </div>
        <div class="x"; style="top:90px; left:230px; "> </div>
        <div class="x"; style="top:90px; left:250px; "> </div>
        <div class="x"; style="top:90px; left:260px; "> </div>
        <div class="x"; style="top:90px; left:270px; "> </div>
        <div class="x"; style="top:100px; left:10px; "> </div>
        <div class="x"; style="top:100px; left:30px; "> </div>
        <div class="x"; style="top:100px; left:60px; "> </div>
        <div class="x"; style="top:100px; left:90px; "> </div>
        <div class="x"; style="top:100px; left:110px; "> </div>
        <div class="x"; style="top:100px; left:130px; "> </div>
        <div class="x"; style="top:100px; left:170px; "> </div>
        <div class="x"; style="top:100px; left:210px; "> </div>
        <div class="x"; style="top:100px; left:220px; "> </div>
        <div class="x"; style="top:100px; left:270px; "> </div>
        <div class="x"; style="top:110px; left:10px; "> </div>
        <div class="x"; style="top:110px; left:20px; "> </div>
        <div class="x"; style="top:110px; left:50px; "> </div>
        <div class="x"; style="top:110px; left:60px; "> </div>
        <div class="x"; style="top:110px; left:70px; "> </div>
        <div class="x"; style="top:110px; left:90px; "> </div>
        <div class="x"; style="top:110px; left:110px; "> </div>
        <div class="x"; style="top:110px; left:130px; "> </div>
        <div class="x"; style="top:110px; left:170px; "> </div>
        <div class="x"; style="top:110px; left:180px; "> </div>
        <div class="x"; style="top:110px; left:190px; "> </div>
        <div class="x"; style="top:110px; left:210px; "> </div>
        <div class="x"; style="top:110px; left:230px; "> </div>
        <div class="x"; style="top:110px; left:250px; "> </div>
        <div class="x"; style="top:110px; left:260px; "> </div>
        <div class="x"; style="top:110px; left:270px; "> </div>
        </div>
</body>
</html>
 
Some Scheme code, unfortunately we lack a highlighter for it:
Code:
(define key 1321)
(define shift_key 89)
(define message
  (list
   "7be74ba0064fadff11be121c981d7bd42880cd3991ea09"
   "49c0fb72cb2f5f0460c0081cb91768d01e84dee53da32689ef3e98fe4eacfe44b8065fc01278"
   "49cbfb95f458a4fd1d6a0765b61e6cd22c32cc3682964291ee4a9f0505b2ff55690460c72126d42675cf3593da2f99ae"
   ""
   "49c0fb78ee53adc6116afc6bcad579c5d989d02d8fdaf0"
   "49c34d99fb0db3b868afc35dc11a27d71e7bdd285c96268da84c98ac4eacb764b10b6e741375d12d7e8a248ad9ee9eef4ba5f0105dff5d681562bc1f25d21f82ce237f"
   "49f940540458a80c566a066bb91327d42832df2589e1ef9cf0fa98ed48a6b75fbd0a60c6db"
   ""
   "49c0fb72cb3aa701646a1a5dc8ce6bc91f78d42792e24356a12353f446b4fc10b7116f742279c41c31cb3195953d8da04d9af0049e025bb7185fb7cc71bf2577de2382d940"
   "49c0fb72cb4fadb8526a0f6bc31527d4227fd0f23dbfef90e23e5300545ef962be1563741c6cc5d87ee3e38cdd3e55"
   "49cbfb98f249a8fc56aec370c4ce7ec12b7f8b398d963ca1a12d96f44aabfc10bc0d64c019797f1978cb2c8aa1ee8be93da0b2585d0a50b3061abf1b73c5e330d3378ee8"
   "49f54aa1f206ab0760b50c6abcce7cd0d97bd9e491de3448f33f99f157a30553aec263b91f6b7f197fcee390dd3399e507"
   ""
   "49c0fb77fc4aa40852aeca6f750f27cc2286df308296318de943a1f005b2ff55691664c112798dd831b3ea80953a96f63e52ff535d0954adc163c7cc7ace1b71dd277fa0"
   "49c0fb96025a5fe111be0b65c31927c92d858b2f82db3f8df34d53f446b4fc10b61171b91126ce2631de323ce4428fe54b52fb56ac0054ab156d81"
   "49cb0298ad59b4ff58af167075f87cd03286d0363dc43e9ce63ca2fb50b1b756b8141bb5cd79c8257ad6248e954288f3445eab5dac0b0fab0268731573d12b71d52e"
   "49ed40a6fb4bab0b11b0126e752468d22281e0373de23096e84f94f34ab1c5"
   ""
   "7be74ba0064fadff11be121ca0177bd32e80d00a8cee09"
   "49cbfba0f651a4b86ab9186e75227cd22d7ed0e480e5338dadfa9c000cb1b753be166082"
   "49db4aa9ad4aae0618bec36aba136b802c77d82d80e53b97ef4d53f5535ee769bd0a6ac2cd7ac72786d12b4a"
   "49d64399ad2e93e53d6a126abace70d3d980d4278296309ba15198f8516cb739690362c6126b7f2f7ade2b3cd73d9be8f994ff5b6bb62a71"
   ""
   "72a23fa3fb0db3b85cb8127375256fd9e532b4e487eb429ca146a2024a5e0b58aec26db9107bd12b7ad9313cea418ce4f99bf90489df4298c166b41a6cd31877ce35"
   "95eb4699ad39a20056b7082875177b802c77d03190964297a13f9ff14c9f056477c244bacd75cd248a8a2c90954588f34759ff04a30561680266bfcc79c61c30cb347cd7388bf34b5d"
   "8bf74f54f65a660b11ab0f6eba0f6bd9d973d9e482e2348fe248a7ac519f0557be0362b9d926c42e76d8e385dbee9be83e52fe5dab0a50c0c163c61a2cd2d784d1273be13c99f3"
   "8eee409bee54b3c611970475b71327a9e07ed7e484e5ef8ef04c53d446b10255b50e1bc2127ed3d885d33081a1ee89f54d52d40baab653ad0763c11579c32389892f8ae632"
   "8fee5099fb5a5f015f6af65fbd1374c5e7"))

(define (process_list func list_in)
  (map (lambda (msg_line)
         (func msg_line key shift_key))
       list_in))

(define (split_hexstring hexstring)
  (define (loop out in)
    (if (> (string-length in) 0)
        (loop (append out
                      (list (string->number (substring in 0 2) 16)))
              (substring in 2))
        out))
  (loop (list ) hexstring))

(define (decode message key shift_key)
  (define (decode_loop decoded residual shift)
    (if (= (length residual) 0)
        decoded
        (decode_loop
         (append decoded
                 (list
                  (modulo (- (- (car residual) shift)
                             key)
                          256)))
         (cdr residual)
         (+ shift shift_key))))
  (list->string
   (map integer->char
        (decode_loop (list ) message 0))))

(define (print_msg_list msg_list)
  (define (loop msgs)
    (if (> (length msgs) 0)
        (begin
          (display (car msgs))
          (newline)
          (loop (cdr msgs)))
        0))
  (loop msg_list))

(print_msg_list (process_list decode (map split_hexstring message)))

Yes it runs in codepad: http://codepad.org/O5SNo2cS
 
  • Love
  • Like
Reactions: Cottontail and WillFord384
NinaAlex said:
Some Scheme code

Wow, haven't read thorough scheming like that for a long time.
 
ElPulpo said:
Wow, haven't read thorough scheming like that for a long time.
Since LISP was specified in 1958, and is the second oldest high level language (Fortran being the oldest), it is still incredibly useable today.
Scheme is a dialect of LISP, that can easily be defined for pure LISP by writing the additional commands as macros.
Since LISP is incredibly extensible, and one can more or less write code that will rewrite, or modify the code, most LISP dialects can run on older compilers, if only a language extension, that does the rewriting is added.

This was actually written and tested for racket (a Scheme dialect) in its legacy Scheme mode.

I love how back then, someone really thought something up that is close to timeless.

LISP and its dialects are still a very powerful high level languages, even over SIXTY years after it was initially specified.
It's capability to write functional code was well ahead of its time.
 
  • Like
Reactions: WillFord384
Back
Top