flat assembler
Message board for the users of flat assembler.

Index > Heap > Esoteric Programming Challenges!

Goto page Previous  1, 2, 3, 4, 5 ... 10, 11, 12  Next
Author
Thread Post new topic Reply to topic
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 16847
Location: In your JS exploiting you and your system
revolution
revolution wrote:
I also would like to issue a small Befunge programming challenge.

Generate random numbers between 1 and 13 inclusive, the distribution must be uniform.
I have a secondary follow-up challenge to this.

Generate random numbers between 1 and 13 inclusive, the distribution must be uniform, and using only one '?' character in the code.
Post 31 Aug 2009, 02:49
View user's profile Send private message Visit poster's website Reply with quote
Pinecone_



Joined: 28 Apr 2008
Posts: 180
Pinecone_
I've updated the first post. Both your challenges are on there revolution.

as for your follow up 1-13 challenge, wouldn't it be quite easy to do so by using the p instruction to write "?" to multiple places in the fungespace? I'm pretty sure this isn't your intention, so if you wish to update the requirements, post what you want and I'll update the first post again.
Post 31 Aug 2009, 03:17
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 16847
Location: In your JS exploiting you and your system
revolution
Actually I deliberately wrote "using only one '?'". Yes, you could write multiple '?'s everywhere but you are not allowed to use them.
Post 31 Aug 2009, 03:20
View user's profile Send private message Visit poster's website Reply with quote
Pinecone_



Joined: 28 Apr 2008
Posts: 180
Pinecone_
good point. Smile ill put a note on the challenge description in the first post though.
Post 31 Aug 2009, 03:45
View user's profile Send private message Reply with quote
windwakr



Joined: 30 Jun 2004
Posts: 827
Location: Michigan, USA
windwakr
Just so you know, Bequnge is broken. IT WILL NOT INTERPRET THIS CORRECTLY! But yours will.
My first REAL try at making something in Befunge.
Code:
"a4A4"v_@#:$,>#+5<
1,:\-2<_$ #: ^#:\+
    

As you can see, I have again "borrowed" ideas from you(part of the left side).....
BTW, 37 bytes Laughing


As you can see in Bequnge, in this, "_$ #" the # actually skips TWO cells, odd behaviour. BUT, this is valid code, and runs fine in yours.

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



Joined: 28 Apr 2008
Posts: 180
Pinecone_
Very good windwakr.

I knew of this bug in bequnge already. It interprets the # command to skip over the next instruction instead of the next character.

You are now the current leader of Challenge 1 in befunge and brainfuck. You should try Challenger now Razz go for 3/3 Razz

Edit: Windwakr's solution does not pause at the end, therefore is not valid. I've updated the first post, my solution is still the leader at 38 bytes.
Code:
"A4"v >91+,"@~a"10p92+0p
:\-2<_^#:\+1,    


Last edited by Pinecone_ on 31 Aug 2009, 15:15; edited 2 times in total
Post 31 Aug 2009, 04:18
View user's profile Send private message Reply with quote
windwakr



Joined: 30 Jun 2004
Posts: 827
Location: Michigan, USA
windwakr
Since there's no real output in Challenger, where would the text need to be for it to be taken for entry, and would the newline character still be needed?

_________________
----> * <---- My star, won HERE
Post 31 Aug 2009, 04:41
View user's profile Send private message Reply with quote
Pinecone_



Joined: 28 Apr 2008
Posts: 180
Pinecone_
Hmmmm... I guess i didnt look closely enough at how Challenger works. You're right. Challenger (unless modified to allow output) will not be suitable for these challenges. First post updated.
Post 31 Aug 2009, 05:15
View user's profile Send private message Reply with quote
windwakr



Joined: 30 Jun 2004
Posts: 827
Location: Michigan, USA
windwakr
Well, you could just have us write the "output" to a certain area in the Challenger space.
Post 31 Aug 2009, 05:41
View user's profile Send private message Reply with quote
Pinecone_



Joined: 28 Apr 2008
Posts: 180
Pinecone_
but where?
Post 31 Aug 2009, 06:02
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 16847
Location: In your JS exploiting you and your system
revolution
Pinecone_ wrote:
good point. Smile ill put a note on the challenge description in the first post though.
Pinecone_ wrote:
Note that using the p instruction to write the "?" command to multiple places is not allowed as the definition of this challenge said "using only one '?' " not that you are to only have one "?" in the source.
Actually putting '?' using p is allowed, just that you are not permitted to use them. Indeed, I think I see the confusion. By "use", I mean you would not be able to execute them, but using them for data would be okay.

Anyhow, just some indicative figures to get you all started.

Challenge 3 - 89 bytes
Challenge 4 - 100 bytes

I have not attempted to minimize the code at all, I just wanted it to run and produce proper results.

BTW, Pinecone_, you have "Challenge 4 - Befunge specific follow up to challenge 13 by revolution" in the first post. I think you meant to put "... challenge 3 by ..."?
Post 31 Aug 2009, 07:07
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
Okay, this is unrelated but kinda cool (in a lame way, if that makes sense):

Code:
@echo off
goto setup

======================================================================
<@,,,,,,,,,,," ASM rocks"+19<p0*27<   v
                                  ^"F"?"N"
                                      ^
======================================================================

:setup
set BAZ=results.txt
if not exist asmrocks.bef goto bye
if exist befunge.exe set BEF=befunge.exe
if exist pinecone\befunge.exe set BEF=pinecone\befunge.exe
if "%BEF%"=="" goto bye
if not exist %BEF% goto bye
:countit
if "%FOO%"=="1111111111" goto end
set FOO=%FOO%1
:nextone
set BAR=%BAR%2
::echo %%FOO%% == %FOO% >> %BAZ%
::echo %%BAR%% == %BAR% >> %BAZ%
%BEF% asmrocks.bef >> %BAZ%
if not "%BAR%"=="2222222222" goto nextone
:foocount
set BAR=
goto countit

:end
echo ===================================
echo   And the votes are in ...    Smile
echo ===================================
echo NASM :
grep -c "NASM" %BAZ%
echo FASM :
grep -c "FASM" %BAZ%
del %BAZ%

:bye
set FOO=
set BAR=
set BAZ=
set BEF=
    


P.S. BefOS already exists! See here (though I'm too lazy to test it now, heh).

EDIT: This really shows how wimpy the bef.c / DJGPP compile's rng is.
Also, CMD.EXE lets you do "for /L %a in (1,1,100) do echo %a", but I couldn't remember (and this way is more portable anyways). Razz


Last edited by rugxulo on 31 Aug 2009, 19:08; edited 3 times in total
Post 31 Aug 2009, 07:35
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 7412
Location: Kraków, Poland
Tomasz Grysztar
Pinecone_ wrote:
but where?

You can go for a place right above the program, like this:
Code:
(2:)"A\>1+.\v
v     <| -Z"<
=     ^<
>((3:)"a\>1+.\v
         | -z"<
         >    

Or perhaps you'd prefer to treat the area to the left as a rotated screen?
Code:
))1:("A\>1+.\v
v      <| -Z"<
=      ^<
>)2:):))"a\>1+.\v
          <| -z"<
           ><    

I created this language, because I wanted something definitely different from those languages like Befunge, I wanted free roaming on the infinite plane and deciding yourself what to do with its vast areas. It even somehow resembles the Conway's game of life.

As for the possible challenges with it, try writing the smallest one that is able to brew its own copy (anywhere) and forward the execution to that copy (so it breeds infinitely). There is already my entry written in Pure Challenger in my thread.
Post 31 Aug 2009, 08:11
View user's profile Send private message Visit poster's website Reply with quote
Pinecone_



Joined: 28 Apr 2008
Posts: 180
Pinecone_
Tomasz Grysztar wrote:
I created this language, because I wanted something definitely different from those languages like Befunge, I wanted free roaming on the infinite plane and deciding yourself what to do with its vast areas. It even somehow resembles the Conway's game of life.
Befunge-98 is supposed to support an infinitely vast plane in every direction.
Post 31 Aug 2009, 10:34
View user's profile Send private message Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 7412
Location: Kraków, Poland
Tomasz Grysztar
Pinecone_ wrote:
Befunge-98 is supposed to support an infinitely vast plane in every direction.

I know this, but in Befunge this plane is really used for nothing more than just code and temporary data storage, and you may not even see what is happening there. I wanted more. I wanted this quasi-biological feeling (that's why there are no absolute coordinates there), easy roaming in any direction and program being its own output itself.
Post 31 Aug 2009, 10:40
View user's profile Send private message Visit poster's website Reply with quote
Pinecone_



Joined: 28 Apr 2008
Posts: 180
Pinecone_
That is quite a unique concept. It would be interesting to make a game of life in your language just to see it.
Post 31 Aug 2009, 12:37
View user's profile Send private message Reply with quote
Pirata Derek



Joined: 31 Oct 2008
Posts: 259
Location: Italy
Pirata Derek
BRAINFUCK:
Its name tells you what it does...

Laughing
Post 31 Aug 2009, 13:17
View user's profile Send private message Send e-mail Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 7412
Location: Kraków, Poland
Tomasz Grysztar
Pinecone_ wrote:
That is quite a unique concept. It would be interesting to make a game of life in your language just to see it.
The original Conway's game would be quite hard to implement, mainly because if you did go for unbounded one, you'd probably sooner or later destroy (overwrite) your own program in the process.

But, speaking of interesing concepts, I'm intrigued by the possibility of instruction that would create a "fork thread" of a program.
Post 31 Aug 2009, 13:45
View user's profile Send private message Visit poster's website Reply with quote
Pinecone_



Joined: 28 Apr 2008
Posts: 180
Pinecone_
How would you keep the threads in sync? Or would that not be an issue? (I'm not too familiar with multi threading)

What if you had an unlimited number of "layers" which you can freely move the data pointer through, allowing you to have data on a layer separate from the code, which resolve the issue of life destroying your code.
Post 31 Aug 2009, 14:35
View user's profile Send private message Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 7412
Location: Kraków, Poland
Tomasz Grysztar
Pinecone_ wrote:
How would you keep the threads in sync? Or would that not be an issue? (I'm not too familiar with multi threading)

The point is they would be able not only to cooperate, but also to compete this way, just like in Core Wars.

Pinecone_ wrote:
What if you had an unlimited number of "layers" which you can freely move the data pointer through, allowing you to have data on a layer separate from the code, which resolve the issue of life destroying your code.
Well, this sounds just a like a three-dimensional variant, doesn't it? Wink
Post 31 Aug 2009, 14:39
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, 4, 5 ... 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-2019, Tomasz Grysztar.

Powered by rwasa.