4 Replies - 2941 Views - Last Post: 06 October 2014 - 11:21 AM Rate Topic: -----

#1 Julyuary  Icon User is offline

  • D.I.C Head

Reputation: 38
  • View blog
  • Posts: 109
  • Joined: 20-December 11

Binary to Decimal in Brainf***

Posted 06 October 2014 - 09:52 AM

It's a very simple program, granted I probably won't understand it next week. It uses an algorithm at the very end that converts the result to characters. The maximum input pretty much depends on the cell size of whatever compiler/interpreter you're using, but the result to character conversion is only accurate up to 999.

>+[>[-]<[-],[>+>+<<-]>>[<<+>>-]>>[-]<
[>+>+<<-]>>[<<+>>-]<[<+>>+<-]>[<+>-]<<<<[--
-------------------------------------------
---[>>+<<-]]<]>>>>>>++++++++++<<[->+>-[>+>>
]>[+[-<+>]>+>>]<<<<<<]>>[-]>>>++++++++++<[-
>-[>+>>]>[+[-<+>]>+>>]<<<<<]>[-]>>[>++++++[
-<++++++++>]<.<<+>+>[-]]<[<[->-<]++++++[->+
+++++++<]>.[-]]<<++++++[-<++++++++>]<.[-]<<
[-<+>]<


Commented for those that care:
Spoiler


I can probably say that this is the worst code I'll ever write.

This post has been edited by macosxnerd101: 06 October 2014 - 09:57 AM
Reason for edit:: Censored title


Is This A Good Question/Topic? 0
  • +

Replies To: Binary to Decimal in Brainf***

#2 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 13491
  • View blog
  • Posts: 53,888
  • Joined: 12-June 08

Re: Binary to Decimal in Brainf***

Posted 06 October 2014 - 09:56 AM

Quote

I can probably say that this is the worst code I'll ever write.

Why is it the worst code you have ever written? Is that mantle solely put on because of the syntax, or the actual logic is whack?
Was This Post Helpful? 0
  • +
  • -

#3 Julyuary  Icon User is offline

  • D.I.C Head

Reputation: 38
  • View blog
  • Posts: 109
  • Joined: 20-December 11

Re: Binary to Decimal in Brainf***

Posted 06 October 2014 - 10:29 AM

I'm really sorry about the title! That was careless of me. It's just the minimalist syntax. Expressing intent without comments seems next to impossible to me.
Was This Post Helpful? 0
  • +
  • -

#4 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 13491
  • View blog
  • Posts: 53,888
  • Joined: 12-June 08

Re: Binary to Decimal in Brainf***

Posted 06 October 2014 - 11:08 AM

Given the language's name, and reputation, I have to say: no doy.
Was This Post Helpful? 0
  • +
  • -

#5 Julyuary  Icon User is offline

  • D.I.C Head

Reputation: 38
  • View blog
  • Posts: 109
  • Joined: 20-December 11

Re: Binary to Decimal in Brainf***

Posted 06 October 2014 - 11:21 AM

Has anyone ever written any sort of input validation in it? The idea makes me shiver.
EDIT: Herp. While it's not very nice to look at, it isn't really suited for this forum since it's logically sound (to me, anyway). My bad.

This post has been edited by Julyuary: 06 October 2014 - 12:08 PM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1