Page 1 of 1

Nice little Mandelbrot (ASCII Art)

Posted: Tue Dec 15, 2009 10:10 am
by waskol
With your OSDK, just build this and enjoy :D

Code: Select all

int main()
{
  int k = 2;
  float i,j,r,x,y=-16,columns=37; 
  cls();
  paper(0); ink(7);
  while (puts(""), y++<15)
    for (x=0; x++<columns; putchar(" .:-;!/>)|&IH%*#"[k&15]))
      for (i=k=r=0;
           j=r*r-i*i-2+(x*84/columns)/25,i=2*r*i+y/10,j*j+i*i<11&&k++<111;
           r=j);
  getchar();
  return 0;
}

Posted: Wed Dec 16, 2009 2:50 pm
by carlsson
Yowsa, that is not the kind of C teached in schoolbooks. While in no way obfuscated, it utilizes the loop constructs quite a lot.

Posted: Wed Dec 16, 2009 10:02 pm
by Dbug
Crap, tried to build it, obviously I broke the linker :(
One more bug in my new version of the osdk...

Posted: Thu Dec 17, 2009 9:07 am
by waskol
carlsson wrote:Yowsa, that is not the kind of C teached in schoolbooks. While in no way obfuscated, it utilizes the loop constructs quite a lot.
Yes, I know, but this is not my work. I just adapted it (in order to fit the number of columns of the Text mode), from a windows source code.

@debug : it compiles here, guaranteed !
I wanted to ask you : are you sure you want to keep the system of batch files for compilation and so forth for your OSDK ? We could use instead some more elaborated scripting engine such like AutoIt, what do you think ?

Posted: Thu Dec 17, 2009 12:00 pm
by Dbug
I'm definitely not going to replace the batch file system by something that works only on windows:

"Compatible with Windows 95 / 98 / ME / NT4 / 2000 / XP / 2003 / Vista / 2008"

Basically, I want something that ideally would:
- be simple to use and modify
- possibly is already installed with the system, or only require a minimum install
- possibly free and open

Now the question is, what is the problem with the batch file, what kind of more elaborate thing you wanted to do ?

Posted: Fri Dec 18, 2009 1:11 pm
by ibisum
(I'd give anything to have this working on Linux. Any possibility?)

Posted: Fri Dec 18, 2009 2:01 pm
by Chema
Dbug wrote:Now the question is, what is the problem with the batch file, what kind of more elaborate thing you wanted to do ?
:lol: This is a recurrent topic... And I think nobody has, till now, gave a good reason for Dbug to drop the batch file system. I also find it really useful, quite easy to change and possibly very easy to port to other OSes.

Granted it does some ugly things with the output and how Euphoric is called, directories with some old files (I remember I had to clean the tmp or bin, don't remember which, as I was having compiling errors -- also I went ARGH many times after running the bat for cleaning the tmp directories and discover it deleted the tap and dsk files I had on the Euphoric's dir) and such, but I frankly cannot imagine another way to do these, which do not depend on using batch files or any other tool.

I'd say that, with the size of Space:1999 and 1337 (Elite-clone) and how they call external tools for several matters, I start to miss a good "make" to avoid recompiling what has not changed, but it is not enough to even consider switching to it, I think.

Better have a full C compiler (I remember errors in the string handling, itoa and such) without bugs... then we'll see :)

Posted: Fri Dec 18, 2009 2:49 pm
by Dbug
ibisum wrote:(I'd give anything to have this working on Linux. Any possibility?)
Well, there is no (finished) native linux port, but it works 100% correctly using Wine, I used it few times already, and it works even on my eeePC running Ubuntu.

Should give a try at least.

Not perfect, sure, but it's working.

Posted: Mon Dec 21, 2009 12:45 pm
by ibisum
I'll give a try under WINE .. but one stupid question: wasn't there a native C compiler for the Oric Atmos at some point, which could be used to build full-blown apps? I must confess to becoming more and more foggy over the years about such things, and was never quite savvy with it in the good ol' days either, not having ever had a microdrive to play with .. :(

Posted: Mon Dec 21, 2009 5:16 pm
by Chema
Yep. There was a linux version of lcc or rcc or were both the same? I used it to build pinforic, but don't remember the details.. :(

I noticed that in http://oric.free.fr/software.html there is no more a link to a linux version, even if all the components should be in http://oric.free.fr/COMPILERS... but you would need to download them separately and make everything work.

I remember using make to build the pinforic executable under linux. Pitty I lost that disk...

If I find more information I will post it here.