flat assembler
Message board for the users of flat assembler.

Index > Heap > Esoteric Programming Challenges!

Goto page Previous  1, 2, 3 ... 5, 6, 7 ... 10, 11, 12  Next
Author
Thread Post new topic Reply to topic
windwakr



Joined: 30 Jun 2004
Posts: 827
Location: Michigan, USA
windwakr
EDIT: LOL, 100th reply in the thread, and 100 byte code in it!

Ok, sat down for a few minutes and came up with this 100 byte brainfuck for challenge 2.

Code:
++++++++++[>+++>++++++>+>+>+++++++++<<<<<-]>++>+++++>--[<.+>-]+++++[>.>.-<<<<......>.+>-]>.--[>.-<-]
    

EDIT: Hmm, this seems to be the optimal stack for this algorithm, time to rethink it if I want to make it smaller.

BTW: What do you guys code these langauges in? I use Notepad with size 12 "Lucida Console" font. Nice fixed width font, fits exactly 100 characters per line. For testing Befunge, I use both Bequnge and Pinecone_'s interpreter(Mainly Pinecone_'s, because Bequnge has a shitty implementation.). For brainfuck, I use this awesome online interpreter.

_________________
----> * <---- My star, won HERE


Last edited by windwakr on 01 Sep 2009, 21:03; edited 3 times in total
Post 01 Sep 2009, 19:58
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 7755
Location: Kraków, Poland
Tomasz Grysztar
I'm going to bother you with my Challanger language again. Wink This is the shortest infinitely self-reproducing program in Framed Challenger I managed to come up with (21 bytes):
Code:
@=).)..))#>?# \#.+_v>    
Post 01 Sep 2009, 20:13
View user's profile Send private message Visit poster's website Reply with quote
rugxulo



Joined: 09 Aug 2005
Posts: 2341
Location: Usono (aka, USA)
rugxulo
windwakr wrote:
EDIT: LOL, 100th reply in the thread, and 100 byte code in it!


Laughing Cool

windwakr wrote:

BTW: What do you guys code these langauges in? I use Notepad with size 12 "Lucida Console" font. Nice fixed width font, fits exactly 100 characters per line. For testing Befunge, I use both Bequnge and Pinecone_'s interpreter(Mainly Pinecone_'s, because Bequnge has a shitty implementation.). For brainfuck, I use this awesome online interpreter.


Mostly just a plain text editor (TDE) and testing via Pressey's BEF or Pinecone's Befunge manually. But I've also been using ZBefunge (+ Frotz) a lot too.

EDIT: I haven't solved (and may not!) revolution's challenge yet, but here's what I did do (not that impressive, I admit, but was kinda tricky).

Code:
v v  <   1
>#@ #. #4?2v
         3
     ^   < <
    
Post 02 Sep 2009, 00:37
View user's profile Send private message Visit poster's website Reply with quote
rugxulo



Joined: 09 Aug 2005
Posts: 2341
Location: Usono (aka, USA)
rugxulo
BTW, found a neat snippet from here (that I didn't write, obviously):

Quote:

A program that takes a number and prints it's sum (eg 991 == 19)
Works for *very* big integers.

Code:
~:52*-!#v_887*\--+
        >\.,@
    


Quote:

$ ./a sum2
16523127731232189037956732897543028197584123748327487238047328904780293748901237
09827598024675980246198752678463278461209746237081465278542387543827548235476832
54312865468321541325432615423684528645268453216845126375432765412365427635478263
467254786312547625148254832478132648726487236487236413
1348

Post 02 Sep 2009, 01:00
View user's profile Send private message Visit poster's website Reply with quote
Pinecone_



Joined: 28 Apr 2008
Posts: 180
Pinecone_
windwakr wrote:
Ok, sat down for a few minutes and came up with this 100 byte brainfuck for challenge 2.
Code:
++++++++++[>+++>++++++>+>+>+++++++++<<<<<-]>++>+++++>--[<.+>-]+++++[>.>.-<<<<......>.+>-]>.--[>.-<-]    
Accepted. Smile

windwakr wrote:
BTW: What do you guys code these langauges in? I use Notepad with size 12 "Lucida Console" font. Nice fixed width font, fits exactly 100 characters per line. For testing Befunge, I use both Bequnge and Pinecone_'s interpreter(Mainly Pinecone_'s, because Bequnge has a shitty implementation.). For brainfuck, I use this awesome online interpreter.
I wrote my own javascript/HTML brainfuck interpreter (it is very slow, but useful). (Attached to this post)

Tomasz Grysztar wrote:
I'm going to bother you with my Challanger language again.
Its not bothering us Razz I'm going to try and do some things in it soon. I have a lot of assignments to do this week though so i wont have much time for programming.

Tomasz Grysztar wrote:
This is the shortest infinitely self-reproducing program in Framed Challenger I managed to come up with (21 bytes):
Code:
@=).)..))#>?# \#.+_v>    
It is not working. # is not an instruction (is it?).
Edit: Accepted in a lower post. Thanks to windwakr.


Description: The , instruction is ignored. :P
Download
Filename: Brainfuck Interpreter.zip
Filesize: 2.03 KB
Downloaded: 148 Time(s)



Last edited by Pinecone_ on 02 Sep 2009, 14:23; edited 3 times in total
Post 02 Sep 2009, 08:43
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17474
Location: In your JS exploiting you and your system
revolution
rugxulo wrote:
EDIT: I haven't solved (and may not!) revolution's challenge yet, but here's what I did do (not that impressive, I admit, but was kinda tricky).

Code:
v v  <   1
>#@ #. #4?2v
         3
     ^   < <
    
This also:
Code:
?1.@.2
3
.
@
.
4    
Post 02 Sep 2009, 08:49
View user's profile Send private message Visit poster's website Reply with quote
Pinecone_



Joined: 28 Apr 2008
Posts: 180
Pinecone_
Sorry didn't see this before:

windwakr wrote:
DAMMIT, I couldn't figure out how I had it working before....so here's an 86 byte one....I guess it's better than my 87...
Code:
<>:#,_  v#:"ABCDEFGH"05"ZIYJXKWLVMUTSRQPON"
v#:$,+55<:-1,\,,,,,,:::::*84,\_
<>:#,_@#:$    
That also does not work for me.
Edit sorry! accepted. Smile (i saved as wrong file extension so my brainfuck interpreter was being called instead Razz)
Post 02 Sep 2009, 12:56
View user's profile Send private message Reply with quote
Pinecone_



Joined: 28 Apr 2008
Posts: 180
Pinecone_
Challenge 2 84 bytes befunge:
Code:
<>:#,_v#:"ABCDEFGH"0"ZIYJXKWLVM"0"UTSRQPON"
,,+55$<_v#::,,,,,,,:::::" "
5+>:#,_@>$$5    
Post 02 Sep 2009, 13:29
View user's profile Send private message Reply with quote
windwakr



Joined: 30 Jun 2004
Posts: 827
Location: Michigan, USA
windwakr
Pinecone_, "#" is an instruction in Challenger, don't you see at the bottom of his post in the Challenger thread it says he added two instructions? "#" an "x".

Also, why didn't you update challenge 2 on your first post with yours? It still shows mine.

_________________
----> * <---- My star, won HERE
Post 02 Sep 2009, 13:54
View user's profile Send private message Reply with quote
Pinecone_



Joined: 28 Apr 2008
Posts: 180
Pinecone_
windwakr wrote:
Pinecone_, "#" is an instruction in Challenger, don't you see at the bottom of his post in the Challenger thread it says he added two instructions? "#" an "x".
Nope didn't see it Razz and i tested his code on an old version apparantly Razz Ill go check that out now.

windwakr wrote:
Also, why didn't you update challenge 2 on your first post with yours? It still shows mine.
Oops forgot to do that Smile Thanks. Razz (Forgot because im working on another small improvement for it, its in my head but im just trying to write it and keep mucking it up)
Post 02 Sep 2009, 14:15
View user's profile Send private message Reply with quote
Pinecone_



Joined: 28 Apr 2008
Posts: 180
Pinecone_
Tomasz Grysztar wrote:
This is the shortest infinitely self-reproducing program in Framed Challenger I managed to come up with (21 bytes):
Code:
@=).)..))#>?# \#.+_v>    
Accepted. Smile
Post 02 Sep 2009, 14:23
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17474
Location: In your JS exploiting you and your system
revolution
Would it help things along if I offered a small prize to the first person to post a valid solution, of any size, for either of my challenges? That way you don't have to hold back posting until you have something smaller than the indicative values I posted previously. As soon as you have a working program then post it. NOTE: Only one prize is offered for the first solution to either challenge. Once the prize is given any second person to post a solution to the other of my challenges would not get a prize.
Post 02 Sep 2009, 14:27
View user's profile Send private message Visit poster's website Reply with quote
Pinecone_



Joined: 28 Apr 2008
Posts: 180
Pinecone_
83 bytes befunge challenge 2 Smile
Code:
<v8<"AZYJXKWLVM"
1<_v#:\+1,:\-
v\$<
55<vp13p17"-@U",+
<_^#:-1,\,,,,,,:::::*84,,+55\    
Note: There is a bug in my interpreter which causes this to not print the last line. The script is valid, but if you're using my interpreter to see the output, you will not see the bottom line unless you add a blank line to the script file.

(The bug: When loading a script, it should allocate 25 lines of space even when there is less than 25 lines in the file, but it only allocates the minimum number of lines required to load the file, therefore a # on the bottom line of the file when executed when the execution direction is downwards, it will skip the next command on the top line of the file when it's not supposed to)

revolution,
Code:
^    @~.<<<<<
         ++++
>>>>>>>>^1234
1234567899999
?????????????
^^^^^^^^^^^^^
????????????
^^^^^^^^^^^^
???????????
^^^^^^^^^^^
??????????
^^^^^^^^^^
?????????
^^^^^^^^^
????????
^^^^^^^^
???????
^^^^^^^
??????
^^^^^^
?????
^^^^^
????
^^^^
???
^^^
??
^^    
Im not saying it's the best solution, but i think it works. (259 bytes)

Edit:
Code:
^    @~.<<<<<
         ++++
>>>>>>>>^1234
1234567899999
?????????????
????????????^
???????????^
??????????^
?????????^
????????^
???????^
??????^
?????^
????^
???^
??^
^^    
171 bytes.
Post 02 Sep 2009, 15:34
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17474
Location: In your JS exploiting you and your system
revolution
Pinecone_: Reject. Not uniform distribution. 1 has far less chance than 13.
Post 02 Sep 2009, 16:06
View user's profile Send private message Visit poster's website Reply with quote
Pinecone_



Joined: 28 Apr 2008
Posts: 180
Pinecone_
Hmmmm.... For the second one, yes. But are you sure about that on the first one? (It doesn't limit the left/right wrapping on the first one)
Post 02 Sep 2009, 16:20
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17474
Location: In your JS exploiting you and your system
revolution
Just FYI, random walks are not valid.
Code:
     ^@.<<<<<
         ++++
>>>>>>>>^1234
1234567899999
?????????????
?????????????
?????????????
?????????????
?????????????
?????????????
?????????????
?????????????
?????????????
?????????????
^^^^^^^^^^^^^    
Does not guarantee a uniform distribution.

For a solution to be accepted it must be provable to be perfectly uniform. It is not really very hard to do, google is your friend Wink
Post 02 Sep 2009, 16:24
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17474
Location: In your JS exploiting you and your system
revolution
Pinecone_ wrote:
Hmmmm.... For the second one, yes. But are you sure about that on the first one? (It doesn't limit the left/right wrapping on the first one)
The first one has the opposite problem of 13 being far less likely than 1.
Post 02 Sep 2009, 16:29
View user's profile Send private message Visit poster's website Reply with quote
Pinecone_



Joined: 28 Apr 2008
Posts: 180
Pinecone_
Hmmmmmm..... I guess i still have no idea then. Smile
Post 02 Sep 2009, 17:03
View user's profile Send private message Reply with quote
rugxulo



Joined: 09 Aug 2005
Posts: 2341
Location: Usono (aka, USA)
rugxulo
windwakr wrote:

Befunge-93 Interpreter/Debugger v2.21
AUnsupported instruction ' ' (0xffffffff) (maybe not Befunge-93?)


I discovered that bef won't whine unnecessarily if you pass it the "-q" option. (This doesn't fix the TCC bug, though.) Some examples in Pressey's Befunge93.zip collection require "-q" to run correctly.

revolution wrote:

Just FYI, random walks are not valid.


I have no idea what that means. But obviously his attempt is just a rough guess since you said "?" could only be used once.

Is there a particular reason for wanting to do 1 through 13 randomly? I can only think of card games, tricks, etc. (which would be cool, BTW). Cool

Prize? That's okay, I can make my own star. See? * Wink

revolution wrote:

This also:

Code:
?1.@.2 
3 
. 
@ 
. 
4
    



Wow, much cleaner than mine, go figure, my thought process isn't exactly straightforward I suppose.

Pinecone_ wrote:

Note: There is a bug in my interpreter
...
I have a lot of assignments to do this week though so i wont have much time for programming.


Oh noes x 2. Sad Sad

P.S. Found a Befunge98 interpreter in Lua (which is easy to compile, pure ANSI C) although it's weird in that you have to put your code in a "run('...')" statement. Still, I like this better than some of the other, non-portable solutions (e.g. the D one, CCBI, or Perl one didn't work for me, even on Cygwin). Oh, almost forgot to point to the BashFunge one (but heavily requires 3.2, meh, at least Cygwin works).
Post 02 Sep 2009, 17:07
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17474
Location: In your JS exploiting you and your system
revolution
rugxulo wrote:
But obviously his attempt is just a rough guess since you said "?" could only be used once.
Only for Challenge 4 (my second challenge)
rugxulo wrote:
Is there a particular reason for wanting to do 1 through 13 randomly?
Yes, because it is non-trivial (unlike 1-4, or 1-12 etc. which would be no-brainers) and there is a simple procedure that is very elegant. 1-7 is also elegant but I think would be too easy for you all. Other prime numbers higher up can be nice also, but cumbersome/tedious to implement in befunge. So 13 was a trade-off for not too tedious and not too easy.
rugxulo wrote:
Prize? That's okay, I can make my own star. See? * Wink
Razz
Post 02 Sep 2009, 17:27
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page Previous  1, 2, 3 ... 5, 6, 7 ... 10, 11, 12  Next

< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on YouTube, Twitter.

Website powered by rwasa.