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

POT PROGRAM

Name: andrei !S87oehmX0c 2015-07-08 23:59

GREETINGS FROM ROMANIA! IN THIS THREAD YOUR MISSION IS CODIFY A PROGRAM TO ASK FOR A NUMBER AND RETURNS THIS NUMBER TO THE POWER OF TEN. YOU HAVE USE YOUR FAVORITE PROGRAMMING LANGUAGE AS ONLY ONE CONDITION.

I FOR MY SELF USE BASIC, HERE IS MY CODE:
10 INPUT "Tell me number and I will do magic: ", N
20 LET R = 10
30 FOR I = 1 TO N
40 R = R * 10
50 NEXT I
60 PRINT "THE RESULT OF THE POT IS "; R
70 END


THANK YOU.

Name: Anonymous 2015-07-09 0:09

10 PRINT "POT PROGRAM"
20 PRINT "SMOKE WEED EVERYDAY"
30 GOTO 20

Name: andrei !S87oehmX0c 2015-07-09 0:11

>>2 THAT PROGRAM DOES NOT COMPUTE VERY WELL BECAUSE YOU MISSED ONE IMPORTANT THING:
40 END

Name: Anonymous 2015-07-09 4:22

420 PRINT "BLAZE IT!"
430 GOTO 420
440 END

Name: Anonymous 2015-07-09 21:48

(progn (write-line "give number??!") (print (let ((f (lambda (f n r) (if (= n 1) r (funcall f f (- n 1) (* r 10)))))) (funcall f f (read) 10))))

Name: Anonymous 2015-07-09 22:09

>>5
you're missing parenthesis, also it didn't work:

17:07 $ clisp
i i i i i i i ooooo o ooooooo ooooo ooooo
I I I I I I I 8 8 8 8 8 o 8 8
I \ `+' / I 8 8 8 8 8 8
\ `-+-' / 8 8 8 ooooo 8oooo
`-__|__-' 8 8 8 8 8
| 8 o 8 8 o 8 8
------+------ ooooo 8oooooo ooo8ooo ooooo 8

Welcome to GNU CLISP 2.49 (2010-07-07) <http://clisp.cons.org/>

Copyright (c) Bruno Haible, Michael Stoll 1992, 1993
Copyright (c) Bruno Haible, Marcus Daniels 1994-1997
Copyright (c) Bruno Haible, Pierpaolo Bernardi, Sam Steingold 1998
Copyright (c) Bruno Haible, Sam Steingold 1999-2000
Copyright (c) Sam Steingold, Bruno Haible 2001-2010

Type :h and hit Enter for context help.

[1]> (progn (write-line "give number??!") (print (let ((f (lambda (f n r) (if (= n 1) r (funcall f f (- n 1) (* r 10)))))))))
give number??!

NIL
NIL
[2]> (quit)
Bye.

Name: >>6 2015-07-09 22:11

>>5
fuck nevermind

Name: Anonymous 2015-07-10 16:42

>>> pot = lambda n: reduce(lambda x,y: x*y, [10]*n)
>>> pot(3)
1000
>>> pot(3) == 10 ** 3
True
>>> pot = lambda n: reduce(lambda x,y: x*y, [n]*10)
>>> pot(3)
59049
>>> pot(3) == 3 ** 10
True

Name: Anonymous 2015-07-10 17:43

Huh? >>1 computes "10 the the power of a number", not "a number to the power of 10". HIBT?

I think it's even 10n+1. IHBT.

Name: Anonymous 2015-07-11 3:20

>>8
what language is this?

Name: Anonymous 2015-07-11 7:44

CHGECK MY DUBBB OMG DUBBB DUBBB DUBBB

Name: Anonymous 2015-07-11 22:42

>>10
FIOC 2.7

Name: Anonymous 2015-07-14 3:57

>>10
Judging from the lambdas everywhere, it looks like the lambda calculus.

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