[ 3 / biz / cgl / ck / diy / fa / ic / jp / lit / sci / vr / vt ] [ index / top / reports ] [ become a patron ] [ status ]
2023-11: Warosu is now out of extended maintenance.

/jp/ - Otaku Culture


View post   

File: 536 KB, 754x975, Nerevar_reborn.png [View same] [iqdb] [saucenao] [google]
8209198 No.8209198 [Reply] [Original]

(define (calc-moveset attacks success)
(if (not (null? attacks))
(cons (calc-attack (car attacks) (car success)) (calc-moveset (cdr attacks) (cdr success)))))

(define (calc-attack attack success)
(if (char=? #\t success) attack
(if (char=? #\y success) (if (char=? attack #\a) #\b
(if (char=? attack #\b) #\g
#\a))
(if (char=? attack #\a) #\g
(if (char=? attack #\b) #\a
#\b)))))

>> No.8209211

Haskell is cleaner than Lisp

>> No.8209224

>>8209198

Dat battle system.

>> No.8209229

Fuck, you made me remember that paper about optimization of logarithms to find prime numbers that I have to finish in the before the next monday yet I didn't start, I'm pretty much dead, but I don't know if kill myself or kill my teacher.

>> No.8209244
File: 102 KB, 400x400, 1309297717417.png [View same] [iqdb] [saucenao] [google]
8209244

<?php include ("get_out.php");
echo ("Get out of /jp/");
?>

>> No.8209291

>>8209244
> PHP

ahaha 7/10

>> No.8209293

>>8209211
Go back to Reddit, Xarn.

>> No.8209333
File: 82 KB, 667x717, dionkeyagainidontknow.jpg [View same] [iqdb] [saucenao] [google]
8209333

>>8209291

Fancy meeting you here.

>> No.8209365

>>8209293
But he's right.

>> No.8209364

do
{
cout<< "Get out!";
}
while(OP == fag);

>> No.8209397

puts("Suck my cock, dude\n");

>> No.8209409

>>8209291
>using hipster bullshit programming languages instead

I'll be enjoying my PHP, retard.

>> No.8209415

>>8209409
s/hipster bullshit/good/
PROTIP: PHP wasn't the first "Web language" and just because it's popular does not mean it's good. In fact it's easily one of the worst languages out there. It's like writing a C program entirely with the preprocessor while stabbing yourself in the cock.

>> No.8209449
File: 40 KB, 300x360, 1281563174606.jpg [View same] [iqdb] [saucenao] [google]
8209449

>>8209415
Hipster.

>> No.8211167

Why don't you put the attacks and successes together in the same list? That way you can just use map instead of consing the result by hand.

Also, my Lisp dialect is cooler than yours. You've probably never heard of it.

(defn calc-attack [attack success]
  (condp = success
    \t attack
    \y (condp = attack
         \a \b
         \b \g
         \a)
    (condp = attack
      \a \g
      \b \a
      \b)))

(defn calc-moveset [attacks-and-successes]
  (map (partial apply calc-attack)
    attacks-and-successes))

>>
Name
E-mail
Subject
Comment
Action