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

Join 109,156 Programmers for FREE! Ask your question and get quick answers from experts. There are 1,087 online right now! We've got more than 500 tutorials and 2,000 snippets. Join and find out why Dream.In.Code is the #1 programming help community on the internet! Registration is fast and FREE... Join Now!



Review my code

 
Closed TopicStart new topic

Review my code, brainf*ck

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


T3H R0XX0R!

Group Icon
Joined: 6 Feb, 2008
Posts: 2,575



Thanked 51 times

Dream Kudos: 1450

Expert In: (X)HTML, CSS, Batch Scripting, C, C++

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 - 03:44 PM
User is online!Profile CardPM

Go to the top of the page

Closed TopicStart new topic
Time is now: 9/5/08 05:16PM

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