1. Euphoria

Chris Lewis writes:
> I recently got a shareware copy of Euphoria (from A.P.C.), and have printed
> out the manual and had a quick glance at it.  My question is, can I read in
> from file 32-bit floating point binary data ??
> I presume that if I can read this in I can then manipulate and display it.
> If this is not yet possible, is there any chance that this type of
> functionality may be introduced ??

There's currently no good way to do this, but there will be soon.
Quite a few people have asked for this. The only thing you can do
currently is to read/write floating-point numbers in human-readable
decimal form via get/print or printf. This is fairly slow and you
might lose some precision.

In 1.5 beta-2, which should be available in a day or two, there
will be fast, perfectly accurate, conversion routines that will
enable you to read/write 32-bit or 64-bit binary floating point data,
i.e. routines to convert to/from sequences of 4 or 8 byte-values that
are in the IEEE format used by Intel machines.

There will also be a few other enhancements. I'll post a message
when beta-2 is ready. It should be the final beta before the
official release of v1.5 later this month.

Regards,
  Rob Craig
  Rapid Deployment Software

new topic     » topic index » view message » categorize

2. Euphoria

Hi!

I'm a PC programmer. I am fluent in BASIC, and have experimented with many
other languages but BASIC has been usually best suited to my needs.  I found
Euphoria and tried it out, and it is <EM>really</EM> cool!  (Pardon my
HTML.)  I need some help, though, using Euphoria.  The syntax of modifying
variables, being somewhat different from BASIC, kindof confused me at first.
  If anyone can help me (i.e. send some demoish stuff) please do.

PLEASE email me (hackman_17 at hotmail.com) because Euphoria is really cool,
but I need some help.

TNX*1.0E!

______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com

new topic     » goto parent     » topic index » view message » categorize

3. Re: Euphoria

On Sat, 13 Nov 1999, you wrote:
> Hi!
>
> I'm a PC programmer. I am fluent in BASIC, and have experimented with many
> other languages but BASIC has been usually best suited to my needs.  I found
> Euphoria and tried it out, and it is <EM>really</EM> cool!  (Pardon my
> HTML.)  I need some help, though, using Euphoria.  The syntax of modifying
> variables, being somewhat different from BASIC, kindof confused me at first.
>   If anyone can help me (i.e. send some demoish stuff) please do.

There are really only three kinds of variable in Euphoria:
integers (you know about them)
   1, 57, 204003, -7.....
atoms (called reals in Pascal, floats in C, I forget what in Basic)
   1.99, 3.14159, -66
You do math with these in the usual way, i = i * 4, x = x / 2.....

sequences (either strings of characters, or lists of numbers, or both, mixed)
s = {2,5,7,9,-3}

math happens on each item in a sequence with one call:
s * 2
s will now contain: {4,10,14,18,-6}

coords = { {1,1}, {10,10}, {30,15}, {30,30} }  -- a list of coordinates
coords += 10 -- move the coordinates to the right and down by  10
now coords contains: { {11,11}, {20,20}, {40,25}, {40,40} }

customer =  {"James Brown", "156 Maple Rd.", "Macon, GA", 46, "555-1234"}
here, customer[1] is "James Brown"
        customer[3] is "Macon, GA"
You can move James to Florida by assigning customer[3] = "Panama City, FL"

sequences can be arbitrarily complex. Suppose you need to save info on the
entire Brown family:
customer = {"James Brown",46,"156 Maple Rd.", "Macon, GA","555-1234",
                    {{"Velma",42}, {"Barry",16}, {"Lucy",14}} }

Now you can store info on James, his wife and kids in one variable.
customer[6] is a list of James' dependents.
customer[6][1] is his wife's name and age {"Velma",43}
customer[6][3] is his daughter's name and age {"Lucy",14}

customer[6][2][2] will be 16 (Barry's age)

length(customer[6]) will return 3 = which is the number of items stored in that
sequence (i.e. the number of dependents)

If James had no dependents, the sixth item in customer would be an empty set of
curly braces: {}  to denote an empty sequence.

If James and Velma have another kid (Keisha) you can add her to the list as
follows:  customer[6] = append(customer[6], {"Keisha",1})

Of couse, all this [6][1][2] stuff gets hard to follow, so it's better to set
up some constants so you can refer to things by name, not by number:
constant NAME = 1, AGE = 2, ADDR = 3,  DEPENDENTS = 6

printf(1,"%s is %d years old\n",{ customer[NAME], customer[AGE]}) will print:
James Brown is 46 years old

for i = 1 to length(customer[DEPENDENTS]) do
  printf(1,"%s is %d years old\n", {customer[DEPENDENTS][i]} )
end for

will print:
Velma 42
Barry 16
Lucy 14
Keisha 1

Complicated? Yes, but pretty powerful.

Regards,
Irv Mullins

new topic     » goto parent     » topic index » view message » categorize

4. Re: Euphoria

> There are really only three kinds of variable in Euphoria:
> integers (you know about them)
>    1, 57, 204003, -7.....
> atoms (called reals in Pascal, floats in C, I forget what in Basic)
>    1.99, 3.14159, -66

A side remark: an atom, which has a value of 5, has this value stored as an
integer.
Only when the value is out-of-range, the interpreter will decide to convert the
datatype
internally.

> You do math with these in the usual way, i = i * 4, x = x / 2.....

You can do math without having to worry about the datatype. There is no case
where math
using objects, as well as sequences, integers and atoms, will result in an
error, as long as the
container (where the value is stored) is capable. (objects always are, but if
you are sure you
are using a sequence, you can also use a sequence. If you are sure there are no
objects, nor
sequences in your calculation, you can store the value in an atom, if are sure
the value is
within reach of an integer. Store it in an integer.

If you think this all is too complicated ... just name everything object, and
discard the whole
concept of datatypes.

> coords = { {1,1}, {10,10}, {30,15}, {30,30} }  -- a list of coordinates
> coords += 10 -- move the coordinates to the right and down by  10
> now coords contains: { {11,11}, {20,20}, {40,25}, {40,40} }

Interesting: math between two sequences:
It may only occur when both sequences are of the same length.
This, how tempting, is (unfortunately ?) not allowed ..

coords += {10, 5}

But you could write a function for it ... example:

global function recurse_add (object l, object r)
    -- Note: am using short-circuiting!
    if sequence (l) and sequence (r) and length(l) != length(r) then
        for index = 1 to length(l) do
            l[index] = recurse_add (l[index], r)
        end for
        return l
    else
        return l + r    -- Otherwise Euphoria handles it alright
    end if
end function




Ralf Nieuwenhuijsen

[[ Email ]]
    nieuwen at xs4all.nl
    ralf_n at email.com

[[ I-Seek-You ]]
   UIN: 9389920

[[ The Elevator ]]
    http://www.xs4all.nl/~nieuwen



Download NeoPlanet at http://www.neoplanet.com

new topic     » goto parent     » topic index » view message » categorize

5. Re: Euphoria

Sorry guys if this sounds like a shameless plug, but I've received
multiple inquiries about Crash Course and game programming today so I
thought I'd toss this out for mass consumption.  Please no flames.

On Tue, 27 Jan 1998, Florian Bruecher wrote:
> I have some questions about your crash course!
>
> 1. The crash course from your page at http://exo.com/~lgp/euphoria
>     reach only at week 5!!! (Oh my god,the lines of code should
>     begin at week 6!!! sad  !). When will it start with week6?

Check out the zip archive.  It has more lessons than the html pages.  I
have been on hiatus from the lessons lately, but should pick up on them
again soon.  In the meanwhile, You can still purchase the OidZone
Programmer's Refence book.  It covers the OidZone game engine (completely
written in Euphoria) in gross detail.  Complete design Specification for
the game, programming theory, and a line by line expository of the code.
$40 + Shipping  You also get a disk with the source and art and a license
to use the game code in your own game projects

> 2. What programmes do you use for the sprites? AniVga 1.2 or FastVga?
>    What programmes do you use for the sound?

I am unfamiliar with these.  I used Autodesk Animator and 3D studio to
create the art if that's what you are asking.  The sprite routines that
draw the images onscreen in the game were written by me (and Jiri Babor)in
Euphoria.  The book explains them line by line.

> 3. Do you really programs all this games?
yes.  I wrote every line of game code for all 6 of our games.  I used a
number of "standard" 3rd party Euphoria libraries, all of which are
available from the Official Euphoria Home Page for non game specific
stuff (SFX2, font routines, gif reader, etc)

> 4. Do you want to support us? (Beginner guide for Euphoria)
>    (you can send me some (very) simple sources,like
>      a) how to move sprites
>      b) how to play sound
>      c) collision support?

All of that is covered in detail in the book, and will be covered
eventually in the Crash Course.  There are a number of Euphoria libraries
available for these processes, but no reference other than my book to show
you how to put it all together in a game.

2) To play sounds, Use Jacques Deschenes' SFX2 routines.

1) The easiest way to keep track of sprites is using "Director Sequences"
for each one: Oidata[1]={x,y,dx,dy,active} say would tell you where Oid
#1 is on screen, what direction it's moving and how fast it's going, and
whether or not you need to draw it.  You would have a procedure to figure
out where it's going, set x,y,dx,dy,active and send the appropriate sprite
image to your sprite draw routines to put them on the screen. There are
quite a few sprite libraries for Euphoria available on the Official
Euphoria Home Page: http://members.aol.com/fileseu

3) Collisions between simple objects are easy to do.  Compute a bounding
box (or "collision region") around (or inside) your object and another
around the object you want to test collisions with, and see if part of
either box is inside the other.  Say you have a 10x10 ball at {20,50} and
a 5x5 ball at {23,45} and you want to know if they are colliding.  Get the
screen coordinates of the upper left and lower right corners of each
bounding box, in this case:

x1=20 y1=50  x3=23 y3=45
x2=30 y2=60  x4=28 y4=50

then check to see if x1<=x3<=x2 and y1<=y3<=y2 etc. for all 8 corners.
if any of them are true the two objects are colliding.

Accurate colission detection bewteen big complex shaped objects is pretty
complicated most of the time and beyond what I can explain in a short
note.  For OidZone I just computed smaller collision regions that were
completely inside all animation frames of my spinning weird shaped
asteroids.  To justify it I figured you weren't really damaged until you
"really" hit the asteroid. =) Generally we break a weird object (like a
mountain range or a palm tree) into multiple collision regions and test
each one to approximate.

> 5. How do you program a simple DOS? smile

beats me.  I write games. =)

Michael Packard
Lord Generic Productions
lgp at exo.com http://exo.com/~lgp/euphoria
Coming Soon from LGPGames:  Runner!

new topic     » goto parent     » topic index » view message » categorize

6. Re: Euphoria

------=_NextPart_000_003B_01BD2BDC.40A81A40
        charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable


    Michael Packard
    Lord Generic Productions
    lgp at exo.com http://exo.com/~lgp/euphoria
    Coming Soon from LGPGames:  Runner!
   =20
    As I recall, I "signed up" to be a Runner! beta-tester. Have you =
released a beta, yet? If so, have I been asleep that long?!
   =20
    Later! :)
    ck
   =20

------=_NextPart_000_003B_01BD2BDC.40A81A40
        charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML//EN">
<HTML>
<HEAD>

<META content=3Dtext/html;charset=3Diso-8859-1 =
http-equiv=3DContent-Type>
<META content=3D'"MSHTML 4.71.1712.3"' name=3DGENERATOR>
</HEAD>
<BODY bgColor=3D#ffffff>
<BLOCKQUOTE=20
style=3D"BORDER-LEFT: #000000 solid 2px; MARGIN-LEFT: 5px; PADDING-LEFT: =
5px"><BR>Michael=20
    Packard<BR>Lord Generic Productions<BR><A=20
    href=3D"mailto:lgp at exo.com">lgp at exo.com</A> <A=20
    =
>Coming=20
    Soon from LGPGames:&nbsp; Runner!<BR>&nbsp;</BLOCKQUOTE>
<BLOCKQUOTE=20
style=3D"BORDER-LEFT: #000000 solid 2px; MARGIN-LEFT: 5px; PADDING-LEFT: =
5px">As=20
    I recall, I &quot;signed up&quot; to be a Runner! beta-tester. Have =
you=20
    released a beta, yet? If so, have I been asleep that =
long?!</BLOCKQUOTE>
<BLOCKQUOTE=20
style=3D"BORDER-LEFT: #000000 solid 2px; MARGIN-LEFT: 5px; PADDING-LEFT: =
5px">&nbsp;</BLOCKQUOTE>
<BLOCKQUOTE=20
style=3D"BORDER-LEFT: #000000 solid 2px; MARGIN-LEFT: 5px; PADDING-LEFT: =
5px">Later!=20
    :)</BLOCKQUOTE>
<BLOCKQUOTE=20
style=3D"BORDER-LEFT: #000000 solid 2px; MARGIN-LEFT: 5px; PADDING-LEFT: =
5px">ck</BLOCKQUOTE>
<BLOCKQUOTE=20
style=3D"BORDER-LEFT: #000000 solid 2px; MARGIN-LEFT: 5px; PADDING-LEFT: =

------=_NextPart_000_003B_01BD2BDC.40A81A40--

new topic     » goto parent     » topic index » view message » categorize

7. Euphoria

This is a multi-part message in MIME format.

------=_NextPart_000_014E_01C0BE88.5B0D4580
	boundary="----=_NextPart_001_014F_01C0BE88.5B0D4580"


------=_NextPart_001_014F_01C0BE88.5B0D4580
	charset="iso-8859-1"

Hi it is me again

I am realy wondering whay euphoria is not sou well known (I'w gor two =
friends that are weary good and old programers but they haven't heard =
for Eu).
We shoud make a difrenc and told the world that EU is good and poverful.
My friends are laughing to me becouse I program in Eu. We realy got do =
do something.
I will tray that Slovenian computer magazins will wrote something about =
Eu
Tell your suasion.


Lep Pozdrav
Jan Hancic

------=_NextPart_001_014F_01C0BE88.5B0D4580
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 5.50.4522.1800" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Hi it is me again</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I am realy wondering whay euphoria is =
not sou well=20
known (I'w gor two friends that are weary good and old programers but =
they=20
haven't heard for Eu).</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>We shoud make a difrenc and told the =
world that EU=20
is good and poverful.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>My friends are laughing to me becouse I =
program in=20
Eu. We realy got do do something.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>I will tray that Slovenian computer =
magazins will=20
wrote something about Eu</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Tell your suasion.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Lep Pozdrav<BR>Jan=20

------=_NextPart_001_014F_01C0BE88.5B0D4580--

------=_NextPart_000_014E_01C0BE88.5B0D4580
Content-Type: text/x-vcard;
	name="Jan Hancic.vcf"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
	filename="Jan Hancic.vcf"

BEGIN:VCARD
VERSION:2.1
N:Hancic;Jan
FN:Jan Hancic
ORG:ZAGAsoftware
TITLE:Programmer
TEL;WORK;VOICE:386 040 323 038
TEL;HOME;VOICE:386 01 8325 557
TEL;CELL;VOICE:386 040 323 038
ADR;WORK:;Boss;Zagorica 6.a;Stahovica;;1242;Slovenija
LABEL;WORK;ENCODING=3DQUOTED-PRINTABLE:Boss=3D0D=3D0AZagorica =
6.a=3D0D=3D0AStahovica 1242=3D0D=3D0ASlovenija
ADR;HOME:;;Zagorica 6.a;Stahovica;;1242;Slovenija
LABEL;HOME;ENCODING=3DQUOTED-PRINTABLE:Zagorica 6.a=3D0D=3D0AStahovica =
1242=3D0D=3D0ASlovenija
URL:http://www.myfreehost.com/janovina
URL:http://www.zagasoftware.uni.cc
EMAIL;PREF;INTERNET:alojz.hancic at siol.net
REV:20010406T085123Z
END:VCARD

------=_NextPart_000_014E_01C0BE88.5B0D4580--

new topic     » goto parent     » topic index » view message » categorize

8. Re: Euphoria

>From: alojz.hancic at siol.net
>Hi it is me again

>I am realy wondering whay euphoria is not sou well known (I'w gor two
friends that are weary >good and old programers but they haven't heard for
Eu).
>We shoud make a difrenc and told the world that EU is good and poverful.
>My friends are laughing to me becouse I program in Eu. We realy got do do
something.

Hello Jan:

If your friends haven't heard of Euphoria, it's because they aren't
interested in learning new
things. If they _were_ interested in learning new things, they would have
known about it, and
would have told you why they like it, or do not like it. That is why old
programmers are
replaced by young programmers, who know newer and faster ways to do their
jobs.

Euphoria is good, but it is not very powerful. But power is not necessary
for many tasks.
Suppose I want a program, which I will run once a week. A program to compute
the
payroll, for example.

A C program might take 10 seconds to run.
A Euphoria program might take 30 to do the same job.

Writing the C program might require 3 weeks of my time,
but the Euphoria program only 1 week.

To save the 2 extra weeks I spent writing the C program, I would have to run
the
program 14400 times (saving 20 seconds each time). That would be about 276
years.

I think I will use Euphoria, and use my 2 weeks to go to the beach.

>I will tray that Slovenian computer magazins will wrote something about Eu
>Tell your suasion.

Why don't you learn enough about Euphoria to write the magazine article
yourself?
I am sure you can learn Euphoria more easily than I could learn Slovenian :)

Regards,
Irv

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu