flat assembler
Message board for the users of flat assembler.

flat assembler > Heap > Esoteric Programming Challenges!

Goto page 1, 2, 3 ... 10, 11, 12  Next
Author
Thread Post new topic Reply to topic
Pinecone_



Joined: 28 Apr 2008
Posts: 180
Three esoteric languages have been used in competitions thus far, being Befunge, Brainfuck and Challenger. I'm keeping a record in this post of the challenges, and the smallest solutions in each esoteric language. If you would like to use another esoteric language, just post your solution and I will add it to the solutions for that challenge. Please state which challenge you are writing code for as I will probably not have time to test every solution in every language posted to see the output.

As the Challenger language does not have output instructions, output can be anywhere in the challenger space, as long as the output is true to the challenge description. Both Pure Challenger and Framed Challenger will be considered separate languages for the purpose of these challenges.

And links to FASM interpreters for these languages:
Befunge
Brainfuck
Challenger




Note that if the chosen language permits it, the solutions use \n as the line endings to reduce the script size.

If you have a good idea for a challenge, post it and i will add it to this post if i think it's worthy.




Challenge 1 by Pinecone_:
Produce the following output:
Code:
ABCDEFGHIJKLMNOPQRSTUVWXYZ
abcdefghijklmnopqrstuvwxyz
    
Newline after lowercase alphabet required, and after printing the user is to press any key before the script ends.

Smallest befunge solution so far: 38 bytes by Pinecone_
Code:
"A4"v >91+,"@~a"10p92+0p
\-2<_^#\+1,    
Smallest brainfuck solution so far: 66 bytes by windwakr.
Code:
++++++++++>+>++++++<<-++>>>>+++++<<+>+++++>-<+<.+>-<+<.<-,    





Challenge 2 by Pinecone_:
Produce the following output:
Code:
ABCDEFGH
Z      I
Y      J
X      K
W      L
V      M
UTSRQPON    


Smallest befunge solution so far: 57 bytes by Pinecone_ (Genius idea for tab and backspace from rugxulo)
Code:
<v"\^_`abc%u$#d%t$#e%s$#f%r$#g%q$#h%ponmlkji"
3<_@#,-*9    
Smallest brainfuck solution so far: 100 bytes by windwakr.
Code:
++++++++++>+++>++++++>+>+>+++++++++<<<<<->++>+++++>--<.+>-+++++>.>.-<<<<......>.+>->.-->.-<-    
Smallest Pure Challenger solution so far: 66 bytes by Tomasz Grysztar
Code:
7"A\  v
>1+.\"Z-v>
|<v-U"   <
1|< >"N- |
   |-H"_ x
^<  <    <    




Challenge 3 - Befunge specific by revolution:
revolution on page 3 of this topic wrote:
Generate random numbers between 1 and 13 inclusive, the distribution must be uniform.
Update: The same ? instruction can no longer be used more than once. This is to avoid this challenge being made pointless because of challenge 4 beating it. Note: this means any ? instruction cannot have an arrow directing it back into itself, and loops are no longer acceptable if there is a '?' instruction in them.

No solutions to the current challenge specifications have been posted (search through pages 7 8 and 9 to see working ones before the challenge update)







Challenge 4 - Befunge specific follow up to challenge 3 by revolution:
revolution on page 4 of this topic wrote:
Generate random numbers between 1 and 13 inclusive, the distribution must be uniform, and using only one '?' character in the code.
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.
Edit: I was wrong.
revolution wrote:
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.

So: Putting "?" is legal, but only one ? character can be executed. The same ? character can be executed a number of times.

Smallest Befunge solution so far: 51 bytes by Tomasz Grysztar:
Code:
>10>\93+`v
*v +v+39$_2*\2
>?0^>`#v_1+.@
v>1^   >$    





Challenge 5 idea inspired from one of rugxulo's posts:
Write a brainfuck interpreter. 8 bit data cells which wrap from 0 to 255 and back if increased or decreased past their limit. Return key is to set the current data cell to 0x0A (\n). Other details are up to your implementation.

Smallest Framed Challenger solution so far: 1342 bytes by Tomasz Grysztar
Code:
v        v\+.=1  <
         > =0"0.-v
                  #
       INPUT
                  #
   >              ^
  v        \ "..<

     PROGRAM++++++++++>+>++++++<<-++>>>>+++++<<+>+++++>-<+<.+>-<+<.<-,
  =
>            @v
       v ,,<                                    >&?                v
  !          >v   >v   >v   >v   >v   >v   >v   >0+|
   >   >&",-|>".-|>">-|>"<-|>"+-|>"--|>"-|>"-|  x
  A^       ?&<
    v +0=6  ?&<
  0  .v\+1=7       ?&<                             v          <  &\<
  +   v\1=8            ?&<                        .      >"-|
  .  0 -v=9                 ?&<          >.1\,,&>   "-|   >&1\-|
    + \>0+.1+ >!"@\4*&\%&\?    v                ^.&\+1&<        
  ?     v=B                      ?&<     =                        
       >0+.1\-^>                          ^
  \     v=D                           ?&<
        >0+.0+    v                             v          <  &\<
        v=F                                ?&<.      >"-|
        >0+.0+  |v_=.1\                       &>   "-|   >&1\-|
  > ^ <<         <<                <            <^.&\+1&<        \
                                                ^               ,<   <
         v\+.=1  <                             ^                     <
         > =0"0.-v
                  #
      OUTPUT
                  #
     >      =.\  ^
    ^      \ "..<    
Note: This is 1408 bytes, but includes windwakr's 66 byte brainfuck program, which means the actual interpreter is only 1342 bytes.
Tomasz Grysztar wrote:
There are three special rows on program's plane, marked with "PROGRAM:", "INPUT:" and "OUTPUT:" texts. After the "PROGRAM:" you should put the program to be interpreted and after the "INPUT:" sequence of bytes that will be fed into program when it requests input.
The row following the "OUTPUT:" text will be filled with output generated by program. The row just below program is used for the program's data storage.
...
Note that the newline character (and other control characters) is written into output just as any other character in this implementation






Challenge 6 - Challenger specific by Tomasz Grysztar:
Tomasz Grysztar wrote:
writing the smallest one that is able to brew its own copy (anywhere) and forward the execution to that copy (so it breeds infinitely).


Smallest Pure Challenger solution so far: 134 bytes by Tomasz Grysztar:
Code:
 v>..1+\41\0-\40+5-  v>v
v                    < <  >|
 >  =35\0-\41\0-\^   >v <
        >..1+\0+=.\F-\F+|
  ^ <     v      "   <    <
>=" "  >00+=.\^
    "   " =vA " \  v
    =   = >.\.\.\  ^
        ^            <
 v  ^                    < >    
Smallest Framed Challenger solution so far: 21 bytes by Tomasz Grysztar:
Code:
@=...#>?# \#.+_v>    






Challenge 7 by Pinecone_
Get a number from the user, multiply it by 2 and print it out in reverse.

e.g. the user enters "12345" return "09642" (12345 * 2 = 24690). (Note: solutions in brainfuck will probably only handle input up to 127 because brainfuck cells are only 1 byte each)

Smallest befunge solution so far: 24 bytes by windwakr:
Code:
&2*>#v_@
1+/^ >91+%.8,9    








Other cool stuff this thread

Tomasz Grysztar won a special revolution star for being the first to write a 1 to 13 random number generator with uniform distribution in befunge.
revolution wrote:
Tomasz wins his second prize.

*

Congrats.
...
This is a very special official winner's star only issued by revolution to real winners for excellence in problem solving.





Awesome looking 1-13 random number generator in befunge by revolution:
Code:
             v
    v        ?        v
    v        v        v
 v  ?  v  v  ?  v  v  ?  v
 v  v  v  v  v  v  v  v  v
v?vv?vv?vv?vv?vv?vv?vv?vv?v
0000000009999 9999000000000
1234567891234 4321987654321
+++++++++++++ +++++++++++++
............. .............
@@@@@@@@@@@@@ @@@@@@@@@@@@@    
I think it looks like a cake.






windwakr wrote:
OK, now to present.....windwakr's ALL POWERFUL degree converter!
While creating it I found and helped fix two pretty serious bugs in Pinecone_'s interpreter, so I guess it wasn't a waste of time.

To use it, enter what you're converting to and the number. To convert from F to C type "c", and vice versa. Then type in the number you are converting and press enter. And through the magic of Befunge you get the converted degree with up to 1 number after the decimal point.
Code:
<>#,_v#"To C or F?"+55
`"b"~<v"f"_@#`"e"_v#`"c"_@#
      v>`#@_$"F",55v>$"C",
v     >12p55+,902pv>+,12p502p9&09-9-1-`   #v_
v  -*48_v#`-1*48&5< @~,,,,,"-0.4F"_v#!`-9-90<
v       >84*1-\`#v_"C5.0-",,,,,~@  >
>*02g%v          >84*-
0\%g20_02g/\"E"`#v_\   >.8,,~@~,,8.<   _v#`-10,".",8.<    _   v#`\"E"g21/g2
                   >\84*+^           ^*-10< v_v#`\*48   \*2\+*48<
                     \++19\-1         _v#`0< >         ^
                                       >                ^     









Original post:

Hi everyone, I've developed quite a fascination for the language befunge lately. For anyone that doesn't know what it is...

Befunge is a stack-based, reflective, esoteric programming language. It differs from conventional languages in that programs are arranged on a two-dimensional grid. "Arrow" instructions direct the control flow to the left, right, up or down, and loops are constructed by sending the control flow in a cycle.
The first task i set myself for learning to program in this language, (apart from writing an interpreter in FASM [which is pretty much complete apart from a few things which i haven't bothered to fix up yet]) was to write a simple befunge script to print the characters A through to Z in uppercase, then lowercase, on their own lines, followed by a blank line, and the script is to pause until the user presses a key before terminating.

That didn't take long at all after i understood the basic concepts of the language, but then after a while, i started wanting to write it better and smaller, (the assembler programmer coming out in me i guess) and i ended up with a small script of only 55 bytes (linux line endings [\n])

Now, i wonder if anyone here can do better!

The first one i got working was this (79 bytes with linux line endings):

Code:
255*1+"A">,1+\1-#v_v
>55*1+"a"^\        <
^       _v#-1$$,+19 <
         >~@    




after optimizing, here's my final version (55 bytes with linux line endings).
(Edit: i made it smaller in a post further down this page)

Code:
<v"A"2
<<v\+*551
,<\_v#-1\+1
#,+19<@v-1$$
^   "a"_~@    


Edit: Apparantly it wasn't my final version.

Just for clarity, here's the output expected:

Code:
ABCDEFGHIJKLMNOPQRSTUVWXYZ
abcdefghijklmnopqrstuvwxyz
    


Edit: "Last edited by Pinecone_ on 05 Sep 2009, 15:11; edited 76 times in total" Feels like I'm breaking some kind of record Image probably not though... 77 now that I added this Image


Last edited by Pinecone_ on 03 Nov 2009, 00:47; edited 102 times in total
Post 24 Aug 2009, 16:50
View user's profile Send private message Reply with quote
Borsuc



Joined: 29 Dec 2005
Posts: 2468
Location: Bucharest, Romania
It looks obfuscated tbh. Is there a way to write more clean in this language?

_________________
Previously known as The_Grey_Beast
Post 24 Aug 2009, 18:12
View user's profile Send private message Reply with quote
windwakr



Joined: 30 Jun 2004
Posts: 827
Location: Michigan, USA
Hey, it doesn't look as bad as the same thing in brainfuck. Such a pain in the ass to write in brainfuck.

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

_________________
----> * <---- My star, won HERE
Post 24 Aug 2009, 18:37
View user's profile Send private message Reply with quote
pal



Joined: 26 Aug 2008
Posts: 227
No offense, but I don't see why anyone would use a language as such ang as windwakr mentioned, brainfuck. They seem pointlessly complicated. You can obfuscate code in C really well, and I'm sure you can in assembly also.

Don't take this personally as I don't see any point in any language other than assembly (apart from C).
Post 24 Aug 2009, 22:44
View user's profile Send private message Reply with quote
windwakr



Joined: 30 Jun 2004
Posts: 827
Location: Michigan, USA
Actually, they're not complicated, they're way too simple. Brainfuck, for example, has only 8 commands. "> < [ ] + - . ,". That simplicity makes them hard to do anything with. The meanings of all the commands are very easy to understand.

Befunge has 36 commands. I'm gonna have to take a look into it sometime, I love esoteric programming languages.

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



Joined: 28 Apr 2008
Posts: 180
Borsuc wrote:
It looks obfuscated tbh. Is there a way to write more clean in this language?


The design goal of befunge was to make a language that was as difficult as possible to compile, which kind of makes it seem obfuscated in the process. Once you know the commands, its pretty simple to understand alot of things.

And to make it seem a little less obfuscated:
Code:
<v"ABCDEFGHIJKLMNOPQRSTUVWXYZ"+55"abcdefghijklmnopqrstuvwxyz"+550
<,_v#
  @~<    

(the only reason i wrote it as in my first post was for size optimization and to learn the language)

pal wrote:
I love esoteric programming languages.

ME TOO! Razz I've also written a brainfuck interpreter based on most of the same code as my befunge one.

I find befunge alot more interesting than brainfuck, i found out about brainfuck first, then befunge and went a little insane about each.
Post 25 Aug 2009, 00:24
View user's profile Send private message Reply with quote
TmX



Joined: 02 Mar 2006
Posts: 820
Location: Jakarta, Indonesia
pal wrote:
No offense, but I don't see why anyone would use a language as such ang as windwakr mentioned, brainfuck.


Practically, for amusement.
It's said that such languages are Turing-complete, therefor, a real programming language.
Geeky stuff... Laughing
Post 25 Aug 2009, 02:19
View user's profile Send private message Reply with quote
Pinecone_



Joined: 28 Apr 2008
Posts: 180
I made an even smaller one Smile

43 bytes with linux line endings:
Code:
<v-9"#A"
^  >91+,"~@ a"60p81p
1<_^#\+1,\-    


The magic is in:
"~@ a"60p81p
It rewrites the capital A in the first line to lowercase, then removes the quote before ~@ a and replaces it with a space so it's executed next time round. (read up on the p command on the befunge wikipedia page if your a little confused)

Then i tried to better it again with
Code:
"A#"9-v >91+,"~@ a"10p162*+0p
1,\-1<_^#\+    
but they're the same size Sad

If only the language allowed A-F as numbers aswell... then i could replace 162*+ with D and save 4 more bytes...
edit: lol i really should think more about math in the future Razz 162*+ was used to calculate 6*2+1... when all i needed was 7+6 (76+ in befunge) Razz


Im wondering if anyone else is going to try and better this... (i sure am)

TmX wrote:
Geeky stuff... Laughing

so true Smile


Last edited by Pinecone_ on 27 Aug 2009, 17:45; edited 3 times in total
Post 25 Aug 2009, 10:50
View user's profile Send private message Reply with quote
Borsuc



Joined: 29 Dec 2005
Posts: 2468
Location: Bucharest, Romania
pal wrote:
No offense, but I don't see why anyone would use a language as such ang as windwakr mentioned, brainfuck.
Why do you think it's called brainfuck? Wink

_________________
Previously known as The_Grey_Beast
Post 25 Aug 2009, 14:48
View user's profile Send private message Reply with quote
MHajduk



Joined: 30 Mar 2006
Posts: 6020
Location: Poland
First, I think this thread deserves to be moved to the "Projects & Ideas" section due to its non-trivial content. Wink

I've read in Wikipedia that Befunge was designed as only interpreted language due to possibilities of self-modification of the Befunge programs. But self-modification isn't such unusual thing for assembly programmers... Is there possibility that you, Pinecone_, will made (with FASM) some day compiler for it? I think you can consider two ways of doing that:
  • compilation to the native machine code or
  • compilation to the bytecode which would be executed by a special VM.
What do you think about it? Smile
Post 25 Aug 2009, 15:21
View user's profile Send private message Visit poster's website Reply with quote
Pinecone_



Joined: 28 Apr 2008
Posts: 180
39 Bytes Smile Can't believe i didn't think of this earlier when I wrote in my last post
Code:
"A#"9-v >"~@ a"10p90p91+,
1,\-1<_^#\+    


MHajduk,

I read that it was designed to be as difficult as possible to compile (while not being impossible). I can't quite remember where it was, but someone made each line basically a subprogram and whenever the p instruction was executed, whatever line was effected was recompiled on the fly.

As for making a compiler for it, i don't plan on it. Writing an interpreter for this language is very simple, which makes it easy to make a fast interpreter for the language (i know of some things which i could do to improve the speed of my interpreter a lot). I think that if i tried make a compiler to compile to machine language, i would not be able to beat the speed of a good interpreter because of all the extra time required for calculating new code on the fly, which in my eyes makes it a pointless endeavor to make a compiler when an interpreter would run it faster.

However, with some modifications to my interpreter, I could simply attach a script to the executable file and have it read the script attached instead of reading it from a file, It wouldn't take a great deal of work and would give the illusion of compiling, similar to what i think you mean in your second point.

Maybe you have a point about it moving to Projects and Ideas... I'm not sure if I'd class this as a project though, as the focus of the topic is on a challenge (which i seem to be the only one participating in Razz oh well, I'm never one to complain about 1st place... even if it's also last place... Razz)... Ill do a code cleanup and fix the bugs i know of, etc, sometime and post the interpreter in that forum then.


Last edited by Pinecone_ on 25 Aug 2009, 15:49; edited 3 times in total
Post 25 Aug 2009, 15:25
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 16702
Location: In your JS exploiting you and your system
Pinecone_ wrote:
Code:
"A#"9-v >"~@ a"10p90p91+,
1,\-1<_^#\+    
Yep, looks as clear as mud to me.
Post 25 Aug 2009, 15:29
View user's profile Send private message Visit poster's website Reply with quote
Pinecone_



Joined: 28 Apr 2008
Posts: 180
ahh i just realised why i didn't do
Code:
"A#"9-v >"~@ a"10p90p91+,
1,\-1<_^#\+    
before... no newline at the end Sad looks like my 43 byte one still stands.
Code:
"A#"9-v >91+,"~@ a"10p162*+0p
1,\-1<_^#\+    
Post 25 Aug 2009, 15:41
View user's profile Send private message Reply with quote
MHajduk



Joined: 30 Mar 2006
Posts: 6020
Location: Poland
Pinecone_ wrote:
I could simply attach a script to the executable file and have it read the script attached instead of reading it from a file, It wouldn't take a great deal of work and would give the illusion of compiling, similar to what i think you mean in your second point.
Yeah, that sounds quite realistic. Smile You could, for example, place interpreted Befunge code in the resources section of the PE file.
Post 25 Aug 2009, 15:54
View user's profile Send private message Visit poster's website Reply with quote
Pinecone_



Joined: 28 Apr 2008
Posts: 180
MHajduk wrote:
You could, for example, place interpreted Befunge code in the resources section of the PE file.

I'm not 100% sure about this, but cant any amount of data be simply dumped on the end of an executable file without ruining it? If so, all I need to do is change a little code to get it to read the executable file then start reading from the character starting after the normal executable file ends, compile it and use it as a stub (not sure if thats the right word, but still), then any script could be attached as easily as running "copy /b stub.exe+script.bf script.exe" in command prompt (that command came right off the top of my head, correct me if it's wrong)... Is there a way to know the size of the compiled executable at compile time, so i can use it as a constant to know where to start reading from? (I tried this a few days ago, but couldn't figure it out and thought that simply hard coding the size of the interpreter was a bad idea)

Also, if this method was used, does anyone know the chances of it triggering anti virus programs because of a modified executable or something?
Post 25 Aug 2009, 16:22
View user's profile Send private message Reply with quote
rugxulo



Joined: 09 Aug 2005
Posts: 2341
Location: Usono (aka, USA)
Pinecone_ wrote:
Hi everyone, I've developed quite a fascination for the language befunge lately.


A while ago I was very interested in Brainf*** and similar, but I never messed with them too too deeply besides collecting a billion examples.

Quote:

The first task i set myself for learning to program in this language was to write a simple befunge script to print the characters A through to Z in uppercase, then lowercase, on their own lines, followed by a blank line, and the script is to pause until the user presses a key before terminating.

i ended up with a small script of only 55 bytes (linux line endings [\n])

Now, i wonder if anyone here can do better! Smile


Not me. After fiddling for a while (DOSBox + Pressey's bef.c compiled by DJGPP; "-d" is quite helpful but needs ANSI.SYS), the best I could do is 64 bytes (although technically it's not 100% what you did but close enough).

Code:
   93*1-"A"v     >
 v!-1\+1,<
v_\        ^
>91+,"a"90p"@"02p^
    


EDIT: Okay, 62 bytes, wow, big improvement I know (not). Heh.
Code:
>"A"93*1-\  v
  v!-1\+1,<
 v_\        ^
^>91+,"a"20p"@"12p>
    


Quote:

If anyone needs an interpreter, my version (with FASM source code) is attached to this post with everything you need to compile it. Comments, criticism, bugfixes, etc on the source code are all appreciated.)


Only a Windows version? *sniff* Anyways, you don't need to include FASM etc, we all already have it (or can get it easily). As mentioned, I just compiled Pressey's bef.c via DJGPP.

However, just the idea of chess can make somebody very impressed. Wink

Quote:

Now what'd be really embarasing is if no-one posted here Razz I seem to be the only person i know in person who finds this interesting, so i guess it wouldn't surprise me if i got nothing but strange looks of sympathy from people concerned about my mental wellbeing here aswell Razz


Heh, no way! There are too many geeks here. I expect bitrake, vid, and Tomasz have already mastered it and written their own OSes by now. Wink

Quote:

I'm not 100% sure about this, but cant any amount of data be simply dumped on the end of an executable file without ruining it? If so, all I need to do is change a little code to get it to read the executable file then start reading from the character starting after the normal executable file ends, compile it and use it as a stub (not sure if thats the right word, but still), then any script could be attached as easily as running "copy /b stub.exe+script.bf script.exe" in command prompt (that command came right off the top of my head, correct me if it's wrong)... Is there a way to know the size of the compiled executable at compile time, so i can use it as a constant to know where to start reading from? (I tried this a few days ago, but couldn't figure it out and thought that simply hard coding the size of the interpreter was a bad idea)


Try the one pointed to by Wikipedia (BFC). It's basically a 5k Win32 .EXE that dumps the ASCII program source into the .EXE and runs as is compiled.

Just for the record, have you seen BFD? Small Brainf*** optimizing compiler written in NASM. Laughing Laughing

Quote:

Also, if this method was used, does anyone know the chances of it triggering anti virus programs because of a modified executable or something?


100% guaranteed. Heck, Avira whined on the above bfc.exe, so I ended up just deleting it and preferring good ol' Pressey's bef. Wink

P.S. Trickiest parts (for me) were figuring out the correct syntax for "p" ("char" x y p, zero-based) and forgetting to make sure ^ < etc. don't loop around infinitely (easy to make mistakes due to column alignment changes when adding commands). Oh, and accidentally forgetting not to use NTVDM (beep beep beep beep beep ... ad nauseum on errors, gah!!!).


Big thanks for sharing. Smile
Post 26 Aug 2009, 00:53
View user's profile Send private message Visit poster's website Reply with quote
Pinecone_



Joined: 28 Apr 2008
Posts: 180
rugxulo wrote:
EDIT: Okay, 62 bytes, wow, big improvement I know (not). Heh.
Code:
>"A"93*1-\  v
  v!-1\+1,<
 v_\        ^
^>91+,"a"20p"@"12p>
    


Just looking at that, you can remove the last > as it's not needed, also change "a"20p"@"12p to "@a"20p12p and it will have the same effect Smile

Also, notice that your using \ before entering the print loop and also at the end of it, you could move the \ to the start and remove it from before it and at the end of it... which would also let you move the _ into part of the second line and avoid all that nasty padding for the loop by having it just loop back to it's own line (check my 55 byte one in my first post Smile). Hope that was understandable and if it was that it helps Smile good luck getting it smaller Smile feel free to cheat and modify mine if you can make them smaller.

rugxulo wrote:
Only a Windows version? *sniff* Anyways, you don't need to include FASM etc, we all already have it (or can get it easily). As mentioned, I just compiled Pressey's bef.c via DJGPP.

I included fasm and fasm includes because my source code uses slightly modified macros (mainly i capitilised some of the standard macros with fix) and thought it would be easier to simply hand it around with everything needed to compile quickly and easily.

rugxulo wrote:
However, just the idea of chess can make somebody very impressed. Wink

I saw that a few days ago, but it doesn't seem to run in my interpreter. Does anyone know why? Maybe i implimented something slightly wrong... or maybe i just dont know how to move properly Razz if anyone can help, please post Smile I'd really like to see that chess game in my interpreter Razz

rugxulo wrote:
Heh, no way! There are too many geeks here. I expect bitrake, vid, and Tomasz have already mastered it and written their own OSes by now. Wink

Now that would be fun... An entire operating system written in befunge... Smile That reminds me... check out some links from this google search: brainf*ck CPU

rugxulo wrote:
Pinecone_ wrote:
Also, if this method was used, does anyone know the chances of it triggering anti virus programs because of a modified executable or something?
100% guaranteed. Heck, Avira whined on the above bfc.exe, so I ended up just deleting it and preferring good ol' Pressey's bef. Wink

Ok well thats a slight turn off for using that method.. Does anyone know if MHajduk's idea of putting it in as resources would be any better? If not then I'll probably just dump the script on the end of the executable. (Still, anyone know how to get size of compiled executable at compile time?)

rugxulo wrote:
Big thanks for sharing. Smile

No Problem Smile I wasn't gonna let all this work go to waste Razz
Post 26 Aug 2009, 04:49
View user's profile Send private message Reply with quote
MHajduk



Joined: 30 Mar 2006
Posts: 6020
Location: Poland
Pinecone_ wrote:
Does anyone know if MHajduk's idea of putting it in as resources would be any better? If not then I'll probably just dump the script on the end of the executable. (Still, anyone know how to get size of compiled executable at compile time?)
Main advantage of putting Befunge program into the resource section is a possibility of manipulation with it by other applications such as resource editors. I mean here, for example, freeware Resource Hacker which can be run from the command line what will allow to automate whole process of "compilation" (inclusion of the Befunge code into the resource section of the interpreter). Smile
Post 26 Aug 2009, 09:03
View user's profile Send private message Visit poster's website Reply with quote
Pinecone_



Joined: 28 Apr 2008
Posts: 180
what about just grabbing your favorite hex editor and editing it? and as for automating the process of compiling from the command line, the windows copy command will suffice for attaching a script to the end of an executable.
Post 26 Aug 2009, 12:14
View user's profile Send private message Reply with quote
MHajduk



Joined: 30 Mar 2006
Posts: 6020
Location: Poland
Yeah, there are many ways to perform aforementioned task, but I will maintain that use of the 'copy' command isn't most elegant one (however maybe easiest in this case). You can eventually reserve some space in the data section and fill it during "compilation" with the Befunge program code.
Post 26 Aug 2009, 12:25
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 1, 2, 3 ... 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.