Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-4041-

Check out my program

Name: Anonymous 2015-05-03 13:04

#include <stdio.h>
#include <unistd.h>
#define LEN 15
int print(i,j) {
for (; i < LEN; ++i)
printf(" ");
puts("a");
usleep(50000);
return 0;
}
int main(void)
{
int i, j;
for(;;) {
for (j = 0; j < LEN; print(i), ++j)
i = j;
for (j = 0; j < LEN; print(i), ++j)
i = LEN-1-j;
}
return 0;
}


Do you like it?

At first I tried to make it be the SICP snake, with the head going down, but it was too hard for me.

Name: Anonymous 2015-05-03 13:05

A little oops on line 4. print(i,j) should be just print(i)
Sorry!

Name: Anonymous 2015-05-03 13:06

mutating loop variables
side effects in for-loop header
language has null pointers

Pig disgusting.

Name: Mentifex 2015-05-03 13:54

#!/usr/bin/perl
use strict; # PERL by Example (2015) p. 77
use warnings; # PERL by Example (2015) p. 85
our $cns = 32; # size of AI memory for central nervous system.
our $IQ = 0; # PERL by Example (2015) p. 689
our @aud = " "; # PERL by Example (2015) p. 17: auditory array
our $t = 0; # Lifetime experiential time "$t"
sub AudInput; # PERL by Example p. 351 Forward declaration
sub sensorium; # PERL by Example p. 351 Forward declaration
sub think; # PERL by Example p. 351 Forward declaration
sub VisRecog; # PERL by Example p. 351 Forward declaration
TabulaRasa: { # PERL by Example (2015), p. 204: Labels
my $trc = 0; # $trc variable is "tabula rasa counter".
print "Size of experiential memory is $cns \n"; # Increase as needed.
until ($trc == $cns) { # PERL by Example (2015), p. 193: "Loops".
$aud[$trc] = " "; # Fill CNS memory with blank spaces.
$trc++; # PERL by Example (2015) p. 21: autoincrement $trc.
} # End of loop filling auditory memory with blank engrams.
} # End of TabulaRasa "clean slate" sequence.
EnBoot: { # http://mind.sourceforge.net/enboot.html
$t = 0; # English Bootstrap sequence stretches over mental time "$t".
print "English bootstrap is loading into memory... \n";
$t = 0; $aud[$t] = "H"; # Indexing of array begins with zero.
$t = 1; $aud[$t] = "E"; # Single elements of array use $aud not @aud.
$t = 2; $aud[$t] = "L"; # PERL by Example (2015), p. 95: Elements
$t = 3; $aud[$t] = "L"; # AudMem() stores new words at higher $t values.
$t = 4; $aud[$t] = "O"; # Bootstrap "HELLO" is not permanently here.
$t = 5; # A blank gap is necessary between words.
$t = 6; # More bootstrap words will be needed.
}; # http://code.google.com/p/mindforth/wiki/EnBoot
while ($IQ < 8) { # PERL by Example (2015), p. 190
sensorium(); # PERL by Example p. 350: () empty parameter list
think(); # PERL by Example p. 350: () empty parameter list
} # End of main loop calling mind.pl Strong AI subroutines
sub sensorium() { # Start sensory input through sensory modalities.
print " Sensorium: Calling AudInput subroutine: \n";
AudInput(); # PERL by Example p. 350: () empty parameter list
# VisRecog(); -- non-existent subroutine is shown but commented out
} # End of sensorium subroutine in Perl artificial intelligence
sub AudInput() { # As if keyboard input were auditory hearing.
print " AudInput: Enter new IQ: ";
$IQ = <STDIN>; # PERL by Example (2015), p. 50
} # End of auditory input for human-computer interaction
sub think() { # Start showing output as if generated by thinking.
print "Think: My IQ is now $IQ";
} # http://ai.neocities.org/AiSteps.html

Name: Anonymous 2015-05-03 19:22

>>3
Whom are you quoting?

Name: Anonymous 2015-05-03 19:43

I like it, but it's too abrupt. Should aim for a sinusoid or something like that.

Name: Anonymous 2015-05-03 19:59

>>5
The Akashic records.

Name: Anonymous 2015-05-04 1:38

>>4
Hey you, where I can get a copy of Perl by Example?

Name: Mentifex 2015-05-04 7:54

>>8
> where I can get a copy of Perl by Example?
http://www.amazon.com/dp/B00RP3A15O -- is the Kindle e-book,
but you should click from there to the paperback (2015) version
which I bought and from which I cite actual page numbers at
http://ai.neocities.org/AiSteps.html -- showing Perl AI code.

Name: Anonymous 2015-05-04 8:46

Check out my dubs

Name: Anonymous 2015-05-04 9:05

>>10
Hey mister, you dropped these dubs! I'm glad I noticed so I could return them to you.

Name: Anonymous 2015-05-04 17:12

Saddest thing is that this compiles without warnings by default (no flags given) when using GCC.

Name: Anonymous 2015-05-04 17:18

>>12
The only warning is "type defaults to int"

Name: Anonymous 2015-05-04 17:21

>>12
Why should it display any warnings? It looks okay to me.

Name: Anonymous 2015-05-04 17:33

>>14
Well, for example, print takes two parameters, i and j. Neither has type specified (defaults to int). And it's called with only one parameter.

It's insane that this even compiles at all. C is fucked up language.

Name: Anonymous 2015-05-04 17:34

//superior
#include <stdio.h>
#include <unistd.h>
#define LEN 15
int print(i,j) {
for (; i < LEN; ++i)
putchar(' ');
puts("O O O O");
usleep(20000);
return 0;
}
int main(void)
{
int i, j;
for(;;) {
for (j = 0; j < LEN; print(i), ++j)
i = j;
for (j = 0; j < LEN; print(i), ++j)
i = LEN-1-j;
}
return 0;
}

Name: Anonymous 2015-05-04 18:24

//even better
#include <stdio.h>
#include <unistd.h>
#define LEN 15
print(i,j,z ,a2 ,a3 ,a5 ,a7 ,a11 ,a13 ,a17 ,a19 ,a23 ,a29 ,a31 ,a37 ,a41 ,a43 ,a47 ,a53 ,a59 ,a61 ,a67 ,a71 ,a73 ,a79 ,a83 ,a89 ,a97 ,a101 ,a103 ,a107 ,a109 ,a113 ,a127 ,a131 ,a137 ,a139 ,a149 ,a151 ,a157 ,a163 ,a167 ,a173 ,a179 ,a181 ,a191 ,a193 ,a197 ,a199 ,a211 ,a223 ,a227 ,a229 ,a233 ,a239 ,a241 ,a251 ,a257 ,a263 ,a269 ,a271 ,a277 ,a281 ,a283 ,a293 ,a307 ,a311 ,a313 ,a317 ,a331 ,a337 ,a347 ,a349 ,a353 ,a359 ,a367 ,a373 ,a379 ,a383 ,a389 ,a397 ,a401 ,a409 ,a419 ,a421 ,a431 ,a433 ,a439 ,a443 ,a449 ,a457 ,a461 ,a463 ,a467 ,a479 ,a487 ,a491 ,a499 ,a503 ,a509 ,a521 ,a523 ,a541 ,a){
for (; i++ < LEN; )
putchar(' ');
puts("OOOOO");
usleep(20000);

}
main(){ st:;
int i,j;
for ( j = 0; j++ < LEN; print(i=j));
for (j = 0; j++ < LEN; print(i=LEN-1-j));
goto st;}

Name: Anonymous 2015-05-04 18:25

Best so far.

#include <stdio.h>
#include <unistd.h>
#define LEN 15
int print(int i) {
for (; i < LEN; ++i)
putchar(' ');
puts("O O O O");
usleep(20000);
return 0;
}
int main(void) {
int i, j;
for(;;) {
for (j = 0; j < LEN; print(i), ++j)
i = j;
for (j = 0; j < LEN; print(i), ++j)
i = LEN-1-j;
}
return 0;
}

Name: Anonymous 2015-05-04 18:27

>>18
Shit like the rest.

Name: Anonymous 2015-05-04 18:31

>>19
Why? Do better then.
Or are you all talk and no action?

Name: sage 2015-05-04 18:36

sage

Name: Anonymous 2015-05-04 18:37

//Cee
#include <stdio.h>
#include <unistd.h>
#define LEN 15
print(i,j,z ,a2 ,a3 ,a5 ,a7 ,a11 ,a13 ,a17 ,a19 ,a23 ,a29 ,a31 ,a37 ,a41){
while (i++ < LEN)putchar(' ');
puts("x""y""z"); usleep(20000);}
main(i,j){
for (j = 0; j++ < LEN; print(i=j));
for (j = 0; j++ < LEN; print(i=LEN-j));
main(i,j);}

Name: Anonymous 2015-05-04 18:38

Best so far.

main(){puts("check 'em");}

Name: Anonymous 2015-05-04 18:46

#include <unistd.h>
#include <conio.h>
#include <stdio.h>

int main()
{
int a,b,c;
a=1;b=0;
while(1)
{
printf("%d\n",a);
c=a;
a=a+b;
b=c;
}
}

Name: Anonymous 2015-05-04 19:01

>>22
Cee Type Safety and Type Inference

Name: Anonymous 2015-05-04 19:31

>>20
module Snake where

import Control.Monad
import Control.Concurrent

len :: Int
len = 15

iterateur :: [Int]
iterateur = (take len $ iterate (+1) 0) ++ (take len $ iterate (subtract 1) len)

main :: IO ()
main = forever $ do
forM_ iterateur $ \i -> do
putStrLn $ replicate i ' ' ++ "0 0 0 0"
threadDelay 20000

Name: Anonymous 2015-05-04 19:34

Or, to make it more compact like you like,

module Snake where
import Control.Monad
import Control.Concurrent

len :: Int
len = 15
iterateur = (take len $ iterate (+1) 0) ++ (take len $ iterate (subtract 1) len)
main = forever $ do
forM_ iterateur $ \i -> do
putStrLn $ replicate i ' ' ++ "0 0 0 0"
threadDelay 20000

Name: Anonymous 2015-05-04 20:26

>>26,27
How do I run this shit?

Name: Anonymous 2015-05-04 20:36

Use runhaskell snake.hs, Luke.

Name: Anonymous 2015-05-04 20:47

>>29
I don't have that installed and it's apparently inconceivable to do it on Alpine Linux right now.
http://wiki.alpinelinux.org/wiki/Porting_GHC_to_Alpine

Why would I even want that?
The C program runs fine and probably orders of magnitude faster. And works by default with any standard C compiler in the OS, no need to all this Haskell mess. Say no to bloat.

Name: Anonymous 2015-05-04 20:54

>>30
Isn't Haskell compilers a bunch of .c/.h files in the end?

Name: Anonymous 2015-05-04 21:23

>>31
GHC is written in Visual Basic...

Name: Anonymous 2015-05-04 21:40

>>1
Check out my dubs.

Name: analh4x0r420 2015-05-05 2:37

[code]
-- an highly original masterpiece
module Snake where

import Control.Monad
import Control.Concurrent

len :: Int
len = 15

iterateur :: [Int]
iterateur = (take len [0..]) ++ (take len [len,len-1..]) -- 1000x betteur

main :: IO ()
main = forever $ do
forM_ iterateur $ \i -> do
putStrLn $ replicate i ' ' ++ "0 0 0 0"

Name: analh4x0r420 2015-05-05 2:38

-- an highly original masterpiece
module Snake where

import Control.Monad
import Control.Concurrent

len :: Int
len = 15

iterateur :: [Int]
iterateur = (take len [0..]) ++ (take len [len,len-1..]) -- 1000x betteur

main :: IO ()
main = forever $ do
forM_ iterateur $ \i -> do
putStrLn $ replicate i ' ' ++ "0 0 0 0"

lel

Name: Anonymous 2015-05-05 5:39

>>31
GHC is written in endotensors...

Name: Anonymous 2015-05-05 5:42

>>17
whoa

Name: Anonymous 2015-05-05 18:58

>>30
orders of magnitude faster
most of the time is spent sleeping

Well aren't you the Shit-Coder Supreme.

Name: Anonymous 2015-05-05 19:32

>>38
You can't even form proper prose without recurring to imageboard memes, what makes you think you have the right to say that?

Name: Anonymous 2015-05-05 19:39

>>39
I've seen implicit quoting way before I came to imageboards, newfag. Also it's no more of a meme than BBCodes or putting dots at ends of sentences.

Name: Anonymous 2015-05-05 20:11

I came to imageboards
This is a textboard, >>40-nigger.

Name: Anonymous 2015-05-05 20:30

>>41
I came to imageboards from another text-board, dipshit.

Name: Anonymous 2015-05-05 21:31

>>42
This isn't an imageboard.

Name: Anonymous 2015-05-05 22:14

>>41
who are you quoting

Name: Anonymous 2015-05-05 22:50

>>44
He's quoting >>40, dumbfuck. You are most likely one of those "back to jp with your meme" idiots. Guess what, you're the one mindlessly using it as a meme instead of actually wondering why someone's abusing the quote function.

Don't you have some threads to sage downvote on /lounge/? Make it with epic >/g/reentext so your /b/ros at the imageboards can appreciate your classy usage of memes and give you anonymous Internet love.

Name: Anonymous 2015-05-06 1:21

>>45

i want anonymous internet love too

Name: !bWoaiZzZTQ 2015-05-06 2:09

#lang racket

(define LEN 15)

(define sprint
(lambda (i)
(if (>= i LEN)
(display "/\\/\\/\\\n")
(begin
(display " ")
(sprint (+ i 1))))))

(define main
(lambda (i enum)
(let [(new-enum
(cond
((and (equal? enum -) (= i 0)) +)
((and (equal? enum +) (= i LEN)) -)
(#t enum)))]
(sprint i)
(main (new-enum i 1) new-enum))))

(main 0 +)

Name: Anonymous 2015-05-06 12:35

>>47
How do I run this shit?

Name: Anonymous 2015-05-06 13:09

Maybe I can't ``Hello, World!''

Name: Anonymous 2015-05-06 17:42

>>48
$ racket iamfag.rkt

Name: Anonymous 2015-05-06 18:11

>>47
define
define
define

Just use def, ya verbose faggot.

Name: Anonymous 2015-05-06 18:27

>>51
ya verbose faggot

(define def define); ya verbose faggot!

Name: Anonymous 2015-05-06 23:44

>>51
who are you quoting

Name: Anonymous 2015-05-07 0:26

>>53
He's quoting >>51.

I know you're mad because mean people have asked you the same. Try not to abuse the quote function and it won't happen again! Easy, right? What are you waiting for? Start using quotes properly! :)

Name: Anonymous 2015-05-07 1:11

check 'em

Name: Anonymous 2015-05-07 2:04

>>54
Why would >>51 be quoting himself?

>>55
1:11
Nice.

Name: Anonymous 2015-05-07 2:18

>>54,56
Can you two stop assuming >>51-sama is male?

Name: Anonymous 2015-05-07 3:03

>>57
assemble pocketknife image

Name: Anonymous 2015-05-07 3:07

>>56
who are you quoting?

Name: Anonymous 2015-05-07 6:30

>>57
I am not assuming anything. Referring to a person of unknown sex using male pronouns is quite common.

Name: Anonymous 2015-05-07 13:01

How would Cudder write this program?
He wouldn't! Cudder is all talk and no action.

Name: Anonymous 2015-05-07 17:53

>>57
Check your privilege, male programmer!

Name: Anonymous 2015-05-07 18:19

>>57
Can you stop assuming >>51-guy is a weeaboo?

Name: Anonymous 2015-05-07 20:23

>>63
Well, that's just silly. If that were the case, why would he be here?

Name: Anonymous 2015-05-07 20:37

>>57,63
No, it's idiotic to assume otherwise.

Name: Anonymous 2015-05-07 20:49

>>17
I wonder what this does to the stack

Name: Anonymous 2015-05-07 23:52

>>66
Dubs☑

Name: Anonymous 2015-05-08 22:37

>>66
That's easy to investigate.

Name: Anonymous 2015-05-08 22:42

>>68
INVESTIGATE
MY ANUS

Name: Anonymous 2015-05-09 17:18

>>69
who are you quoting?

Name: Anonymous 2015-05-09 17:33

>>70
Hey /g/-friend, here's a tip. We're not actually against quoting anything that wasn't exactly there, or memes or anything like that; we're just against you and your shitty greentext and other idiot memes. It doesn't matter how much you spam,, no one is going to start appreciating your bullshit or treating your posts with anything other than contempt.

Name: Anonymous 2015-05-09 17:36

*farts on thread*

Name: Anonymous 2016-08-27 5:39

who am i quoting

Name: Anonymous 2016-08-27 10:53

>>71
I am against quoting anything that wasn't exactly there, or memes or anything like that. The quoting function has been this way for decades. Go get a new and different function for your trendy news maymays. Hashtags are an example that I don't loathe because people didn't change its use from existing syntax - instead they took an unused symbol in computing and gave it a meaning.

Don't change these.
Name: Email:
Entire Thread Thread List