Welcome to Dream.In.Code
Getting Help is Easy!

Join 132,685 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,268 people online right now. Registration is fast and FREE... Join Now!




Review my code

 
Closed TopicStart new topic

Review my code, brainf*ck

gabehabe
post 28 May, 2008 - 01:05 PM
Post #1


Working Girl.

Group Icon
Joined: 6 Feb, 2008
Posts: 5,441



Thanked 94 times

Dream Kudos: 2625

Expert In: ruling the world.

My Contributions


Hi! I don't know how many people here actually know brainfuck, but I started taking a look at it today. I'm trying to work on a very basic calculator, but it's really hard to find any documentation...

Anyway, if anyone can suggest some useful sites or give me some pointers, I'd be really grateful smile.gif
brainfuck
+++++++++
[>+++++++>++++++++++>+++>+<<<<-]
>++++++.
>++++++++++++++++++++.
++++++.
---------------.
+++++++++++++.
<-------------------------------------.
>-----------------.
<.
++++++++++++++++++++++++++++++++++++++++++++++.
>++++++++++++++++++++.
--------.
-----------.
+++.
+++++++++++++.
<--------------------.
,>.
The main thing is the last line, I want to get a number from the keyboard.
As for everything before it, it basically initialises it all and then outputs "Enter a Number:"
Honestly, I'm not too sure if any of it is the best way to do it. sad.gif

Thanks in advance,
Danny~



EDIT:
Thanks to anyone who considered this, but I managed to figure it out. Here's the code:
brainfuck
[-]>[-]<
>++++++[<+++++++++++++>-]<.
+.
+++++.
---------------.
-----------.
>+++++[<----->-]<-.
>++++[<+++++++++++++>-]<.
>++++[<+++++>-]<.
---.
>+++++++[<---------->-]<+.
>+++++++[<++++++++++++>-]<-.
++.
--------.
>+++++++[<----------->-]<.
>+++++++[<+++++++++++>-]<.
++++++++.
--.
+.
>+++++++[<------------>-]<.
>++++++[<+++++++++++>-]<.
+++.
>+++++++[<---------->-]<+.
>++++++++[<++++++++>-]<+.
>++++++++[<-------->-]<-.
>+++++++[<++++++++++++>-]<-.
----------.
+++++.
-------.
+++++.
-------.
>+++++++[<---------->-]<+.
>++++++[<+++++++++++>-]<++.
+++++.
--.
++.
+++++++++++.
>+++++++[<------------>-]<+.
>++++[<----->-]<.
---.
[-]>[-]<
>+++++++[<++++++++++>-]<-.
>+++++[<++++++++>-]<+.
++++++.
---------------.
+++++++++++++.
>+++++++++[<--------->-]<-.
>+++++++[<++++++++++++>-]<.
+++.
--------.
>++++++++[<---------->-]<+.
>++++++[<+++++++++++++>-]<.
+++++++.
--------.
-----------.
+++.
+++++++++++++.
+.
>+++++++[<-------->-]<-.
>+++++[<----->-]<-.
,>++++++[<-------->-],[<+>-]<.


This post has been edited by gabehabe: 28 May, 2008 - 02:44 PM
User is offlineProfile CardPM

Go to the top of the page

Closed TopicStart new topic
Time is now: 11/23/08 07:17AM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month