Omnimaga: The Coders Of Tomorrow
Welcome, Guest. Please login or register.
 
Omnimaga: The Coders Of Tomorrow
19 June, 2013, 09:15:22 *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   home   news downloads projects tutorials misc forums rules new posts irc about Login Register  
+-OmnomIRC

You must Register, be logged in and have at least 40 posts to use this shout-box! If it still doesn't show up afterward, it might be that OmnomIRC is disabled for your group or under maintenance.

Note: You can also use an IRC client like mIRC, X-Chat or Mibbit to connect to an EFnet server and #omnimaga.

Pages: [1] 2 3   Go Down
  Print  
Author Topic: Brainfuck Programs -  (Read 5953 times) Bookmark and Share
0 Members and 1 Guest are viewing this topic.
nemo
LV9 Veteran (Next: 1337)
*********
Offline Offline

Last Login: 04 April, 2013, 01:12:57
Date Registered: 16 May, 2010, 03:55:30
Posts: 1198

Topic starter
Total Post Ratings: +83

View Profile
« on: 16 August, 2010, 06:40:17 »
0

Brainfuck has become my new hobby. my average number of migraines per minute has skyrocketed. anyway, i decided i'd share some of my programs if anyone's interested. i'll edit in more as i go. if you program in brainfuck and want to add in a few, i'd gladly post them and give credit.

Addition

1
2
3
adds the first memory slot to the second
,>,<[>+<-]

Addition

1
2
3
adds the first memory slot to the second outputs the answer
,>,<[>+<-]>>++++++[<-------->-]<.

Subtraction

1
2
3
subtracts the second memory slot from the first
,>,[<->-]<.


i'll definitely add more later as i become familiar with the language
Logged


DJ Omnimaga
Retired Omnimaga founder (Site issues must be PM'ed to Netham45, Eeems, Shmibs, Deep Thought and AngelFish, not me.)
Editor
LV15 Omnimagician (Next: --)
*
Online Online

Gender: Male
Last Login: Today at 09:02:53
Date Registered: 25 August, 2008, 07:00:21
Location: Québec (Canada)
Posts: 50628


Total Post Ratings: +2637

View Profile WWW
« Reply #1 on: 16 August, 2010, 07:37:53 »
0

I remember checking this language before once, I sure would get confused a lot at it x.x

Can games be done with this language, by the way?
* DJ Omnimaga also hopes that Brainfuck becoming Nemo's new hobby doesn't mean the end of his calculator hobby Big frown
Logged

Retired 83+ coder, Omnimaga/TIMGUL founder. Now doing power metal music (formerly did electronica)

Follow me on Bandcamp|Facebook|Reverbnation|Youtube|Twitter|Myspace
miotatsu
LV6 Super Member (Next: 500)
******
Offline Offline

Gender: Male
Last Login: 11 November, 2011, 23:26:19
Date Registered: 17 July, 2009, 21:33:58
Location: Hidey Hole
Posts: 322


Total Post Ratings: +10

View Profile WWW
« Reply #2 on: 16 August, 2010, 08:34:09 »
0

I am fairly certain there are errors in this program but there is no freaking way I am going to debug it. anyway it is a xp calculator for stick adventures online written in brainfuck. It takes lvl for input and outputs the answer as an ascii character (or at least thats what it would do if it actually worked)

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

thats the most complex bf program I have ever written.

@DJ:
http://www.49-6-dev.net/takingovertheworlden.htm
http://jonripley.com/brainfuck/games/

« Last Edit: 16 August, 2010, 08:51:43 by miotatsu » Logged


PIWORLD まぼろし ~Kuronikuruzu~ Progress: 35%
_player1537
Guest
« Reply #3 on: 16 August, 2010, 09:23:25 »
0

Oooh, I love BrainFuck Cheesy  Try this one on for size (routine sucks probably >.>)

1
2
3
->[->+>+>+<<<]>>>
[-<<<+>>>]<<<<
[->>[-<+>]>[->+<<+>]>[-<+>]<<<<]>,
Multiplies the first number by the second number, and leaves the result in the... 2nd slot I think... Line breaks were added for readability Cheesy
Logged
thepenguin77
z80 Assembly Master
LV10 31337 u53r (Next: 2000)
**********
Offline Offline

Gender: Male
Last Login: Yesterday at 05:33:45
Date Registered: 14 December, 2009, 04:21:52
Location: Purdue
Posts: 1490


Total Post Ratings: +778

View Profile
« Reply #4 on: 17 August, 2010, 20:07:55 »
+1

* DJ Omnimaga also hopes that Brainfuck becoming Nemo's new hobby doesn't mean the end of his calculator hobby Big frown

Worry no more. Now you can combine brainfuck with your calculator.

prgmBRAINFCK
Language is exactly like the real thing, ignores formatting and illegal characters. $0A is even new line. On compile, it only includes the subroutine that you need, the text input is like 50 bytes so you don't always want that.

Here are the specifics to make a source file. The first two characters must be "BF". Then there is an optional comma indicating safe mode (more info later). Finally the name of your program followed by an enter. That's it! Now go program to your heart's content.

Then to get it to compile. Store your source name in string 1. Then just run prgmBRAINFCK. It even warns you if you have different amounts of ['s and ]'s.

The safe mode I added is so that your programs will never clear ram. It puts a little subroutine before every ] that checks for ON presses.

Enjoy.


* brainfckzzzzzzzzxzxzs.gif (45.71 KB, 192x128 - viewed 2216 times.)
* BRAINFCKzzzzzxzxzxz.8XP (0.84 KB - downloaded 95 times.)
Logged

zStart v1.3.012 6-10-2013  zStart fully works on 83+BE's (except custom font)
All of my utilities
TI-Connect Help
You can build a statue out of either 1'x1' blocks or 12'x12' blocks. The 1'x1' blocks will take a lot longer, but the final product is worth it.
       -Runer112
calcdude84se
Needs Motivation
Members
LV11 Super Veteran (Next: 3000)
***********
Offline Offline

Gender: Male
Last Login: 14 May, 2013, 16:12:14
Date Registered: 21 April, 2010, 04:20:59
Posts: 2207


Total Post Ratings: +62

View Profile
« Reply #5 on: 17 August, 2010, 20:14:12 »
0

Haha, nice. Where does the memory pointer start, so we can be sure not to corrupt RAM?
Logged

"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
-Adam Osborne
Bug me about PartesOS. I might just need reminding.
thepenguin77
z80 Assembly Master
LV10 31337 u53r (Next: 2000)
**********
Offline Offline

Gender: Male
Last Login: Yesterday at 05:33:45
Date Registered: 14 December, 2009, 04:21:52
Location: Purdue
Posts: 1490


Total Post Ratings: +778

View Profile
« Reply #6 on: 17 August, 2010, 22:01:56 »
0

It uses appBackUpScreen. So as long as you don't do +[>[-]+]. You shouldn't have any problems.
Logged

zStart v1.3.012 6-10-2013  zStart fully works on 83+BE's (except custom font)
All of my utilities
TI-Connect Help
You can build a statue out of either 1'x1' blocks or 12'x12' blocks. The 1'x1' blocks will take a lot longer, but the final product is worth it.
       -Runer112
calcdude84se
Needs Motivation
Members
LV11 Super Veteran (Next: 3000)
***********
Offline Offline

Gender: Male
Last Login: 14 May, 2013, 16:12:14
Date Registered: 21 April, 2010, 04:20:59
Posts: 2207


Total Post Ratings: +62

View Profile
« Reply #7 on: 17 August, 2010, 22:05:39 »
0

Nice to know. Smiley
How hard (and how large in the generated program) would it be to support more characters? (Right now I'm thinking of the language's own []<>+-,. so I can run a self-interpreter Grin)
Logged

"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
-Adam Osborne
Bug me about PartesOS. I might just need reminding.
Builderboy
Physics Guru
LV13 Extreme Addict (Next: 9001)
*************
Offline Offline

Gender: Male
Last Login: Today at 08:32:53
Date Registered: 20 April, 2009, 00:28:53
Location: Ravenholm
Posts: 5645


Total Post Ratings: +589

View Profile
« Reply #8 on: 17 August, 2010, 22:07:22 »
0

Does it start at the beginning or in the middle?  Like if we move back 1, are we out of the appBackUpScreen?  Oh and epic program Grin
Logged

calcdude84se
Needs Motivation
Members
LV11 Super Veteran (Next: 3000)
***********
Offline Offline

Gender: Male
Last Login: 14 May, 2013, 16:12:14
Date Registered: 21 April, 2010, 04:20:59
Posts: 2207


Total Post Ratings: +62

View Profile
« Reply #9 on: 17 August, 2010, 22:09:26 »
0

Interpreters normally don't define what happens if you go back beyond the zero cell, and I assume thepenguin77 would do the same. I'd guess that it starts at appBackupScreen, then.
Logged

"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
-Adam Osborne
Bug me about PartesOS. I might just need reminding.
thepenguin77
z80 Assembly Master
LV10 31337 u53r (Next: 2000)
**********
Offline Offline

Gender: Male
Last Login: Yesterday at 05:33:45
Date Registered: 14 December, 2009, 04:21:52
Location: Purdue
Posts: 1490


Total Post Ratings: +778

View Profile
« Reply #10 on: 17 August, 2010, 22:25:17 »
0

Silly fix. You couldn't turn your calculator off if you used the key input.

Supporting extra characters is super easy. I currently have a big list of (cp xx \ jr nz, next)'s that I use. The finished product is output in pure assembly so it's size all varies with what you want. Very unoptimized assembly I might add. (32 straight inc (hl)'s in some cases)

The program starts right at the beginning of appBackUpScreen. If you need more space, use a whole bunch of >'s.

Here is a program that takes a 1 digit input, squares it, and outputs the 2 digit result.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
:BF,AA
:,----- ----- ----- ----- ----- ----- ----- ----- ----- ---
:[
:>+
:>+
:<<-
:]
:>
:[
:>
:[>+>+<<-]
:>
:[<+>-]
:<<-
:]
:>>+++++ +++++.
:>[>+<-]     ;hex to decimal starts here (after the >), give it the number in (current) and it will output the result
:>
:>+++++ +++++
:<
:[
:>
:[>+>+<<-]
:>
:[-<<-[>]>]
:>
:[<<+>>-]
:>+
:<<<<
:]
:+++++ +++++
:>[<->-]<
:[>+<-]
:+++++ +++++ +++++ +++++ +++++ +++++ +++++ +++++ +++++ +++
:[>+>>>>+<<<<<-]
:>>>>>.<<<<.
:>+++++ +++++.

There's a hex to decimal converter in there. It just can't accept numbers that end in 0. 20 is 1:.

Edit:
   Forgot to attach program. Source's there too if you want it.

* BRAINFCKy.8XP (0.85 KB - downloaded 97 times.)
* brainFck.z80 (7.18 KB - downloaded 61 times.)
« Last Edit: 17 August, 2010, 22:26:33 by thepenguin77 » Logged

zStart v1.3.012 6-10-2013  zStart fully works on 83+BE's (except custom font)
All of my utilities
TI-Connect Help
You can build a statue out of either 1'x1' blocks or 12'x12' blocks. The 1'x1' blocks will take a lot longer, but the final product is worth it.
       -Runer112
DJ Omnimaga
Retired Omnimaga founder (Site issues must be PM'ed to Netham45, Eeems, Shmibs, Deep Thought and AngelFish, not me.)
Editor
LV15 Omnimagician (Next: --)
*
Online Online

Gender: Male
Last Login: Today at 09:02:53
Date Registered: 25 August, 2008, 07:00:21
Location: Québec (Canada)
Posts: 50628


Total Post Ratings: +2637

View Profile WWW
« Reply #11 on: 18 August, 2010, 18:17:44 »
0

lol nice program ThePenguin77 Grin

I remember juju2143 made one a few months ago but it was in BASIC and interpreted, so some stuff probably took an insane amount of time to execute. It was still cool, though.
Logged

Retired 83+ coder, Omnimaga/TIMGUL founder. Now doing power metal music (formerly did electronica)

Follow me on Bandcamp|Facebook|Reverbnation|Youtube|Twitter|Myspace
ztrumpet
The Rarely Active One
LV13 Extreme Addict (Next: 9001)
*************
Offline Offline

Gender: Male
Last Login: 11 June, 2013, 05:10:51
Date Registered: 08 November, 2009, 21:10:12
Location: Michigan
Posts: 5688


Total Post Ratings: +360

View Profile
« Reply #12 on: 18 August, 2010, 18:25:28 »
0

Wow, that's neat.  Excellent job The Penguin! Grin
Logged

patriotsfan
LV4 Regular (Next: 200)
****
Offline Offline

Gender: Male
Last Login: 14 April, 2013, 20:27:27
Date Registered: 08 August, 2010, 00:32:49
Location: New England, USA
Posts: 116


Total Post Ratings: +2

View Profile
« Reply #13 on: 19 August, 2010, 03:00:18 »
0

Brainfuck on the calculator? That is pretty impressive to say the least. Awesome job! Cheesy
Logged



Doomsday: 12/21/2012 6:11 AM EST 11:11 AM GMT
DJ Omnimaga
Retired Omnimaga founder (Site issues must be PM'ed to Netham45, Eeems, Shmibs, Deep Thought and AngelFish, not me.)
Editor
LV15 Omnimagician (Next: --)
*
Online Online

Gender: Male
Last Login: Today at 09:02:53
Date Registered: 25 August, 2008, 07:00:21
Location: Québec (Canada)
Posts: 50628


Total Post Ratings: +2637

View Profile WWW
« Reply #14 on: 21 August, 2010, 18:22:50 »
+1

* DJ Omnimaga wonders if Ztrumpet could write Starcraft in brainfuck
Logged

Retired 83+ coder, Omnimaga/TIMGUL founder. Now doing power metal music (formerly did electronica)

Follow me on Bandcamp|Facebook|Reverbnation|Youtube|Twitter|Myspace
Pages: [1] 2 3   Go Up
  Print  
 
Jump to:  

Powered by EzPortal
Powered by MySQL Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Powered by PHP
Page created in 0.509 seconds with 31 queries.
Skin by DJ Omnimaga edited from SMF default theme with the help of tr1p1ea.
All programs, games and songs avaliable on this website are property of their respective owners.
Best viewed in Opera, Firefox, Chrome and Safari with a resolution of 1024x768 or above.