1. 15 Puzzle and questions

Hello all.

I am programming in Euphoria from the passed Christmas holidays, and I
believe it is a fantastic language.

I have ported 15 Puzzle to Windows (thanks to Ralf Nieuwenhuijsen, Irv
Mullins, Al Getz and all those which have used the initial version for
MS-DOS). Euphoria+Win32Lib it is an explosive couple. Thank you very much to
RDS, David Cuny and the other contributors.

15PUZZLE v. 1.0 is freeware and it can be downloaded from
http://usuarios.iponet.es/rodoval/programas. If this can be an adequate
manner of making it, I put it at the disposal of RDS for the archive. I have
attempted to translate the program to English and French, but I only am
fluent in my own language (Spanish), so the texts can have errors. The texts
are contained in the files "español", "english" and "français". Use
"15puzzle <language>" (or "copy <language> textos.dat"). These files can be
corrected with a text editor. Also is possible to add aditional text files.

Now, some questions and suggestions:

EUPHORIA:

Questions:

Euphoria provides a method to show a message when is produced a run-time
error, but in the documentation is specified that only operates with the
registered version of EX(W).EXE (not distributable, neither independently
nor binded), thus this characteristic seems almost useless, since only it
will be taken advantage by the users of my program that they will be at the
same time user registered of Euphoria. It is thus?

According to seems, Euphoria it is a pseudocompiler, of the sort of Visual
Basic. Why then it does not save pseudo-code in disk? Would not be more
efficient?

Suggestions:

A method to comment large code blocks. A "if 0 then" is not a good method,
since the syntax is checked.

The scope rules are prone to collisions of identificators. The not declared
libraries do not have to be accessible.

Less important: direct functions reference. Sentences of the type "if
message_box(...) then end if" or "x = message_box(...)" are artificial.

Win32Lib:

How it can be changed the icon of a program?

It can be changed the mouse pointer shape?

Are there any method for knowing the dimensions of a bitmap loaded from
disk?

Thanks

(I hope you understood something of this message!)

Saludos,

Rodolfo Valeiras.
mailto:rodoval at iponet.es
http://usuarios.iponet.es/rodoval/

new topic     » topic index » view message » categorize

2. Re: 15 Puzzle and questions

At 12:03 a.m. 02-02-99 +0100, you wrote:
>Hello all.

Hola y bienvenido ;)

>According to seems, Euphoria it is a pseudocompiler, of the sort of Visual
>Basic. Why then it does not save pseudo-code in disk? Would not be more
>efficient?

Theoricaly true, but in practice Euphoria pre-compiles 35.000 lines per=
 second
on a P-150... you wouldn't notice the diference. Also pre-compiling the full
source each time makes it easier for the debugger/profiler.

>A method to comment large code blocks.

Like Pascal's (* *) or C's /* */? mmmhhh... maybe /-- --/?

> A "if 0 then" is not a good method,
>since the syntax is checked.

I don't understand.

>The scope rules are prone to collisions of identificators. The not declared
>libraries do not have to be accessible.

Well, there has been along discussion about Euphoria's namespace
limitations. RDS is aware of this and will resolve on the near future (I
hope) the issue.

>Less important: direct functions reference. Sentences of the type "if
>message_box(...) then end if" or "x =3D message_box(...)" are artificial.

Don't understand neither.

>Win32Lib:
>
>How it can be changed the icon of a program?

This ain't preciscly a win32lib issue. The icon of an executable is stored
on a resource file statically linked to the .exe file. EXW.EXE doesn't have
any icon, so Windows choose the default one. I investigated a bit on a way
to add/append/modify icons on exe files. There are some API functions that
let you do that, but they are only for NT. If anyone is interested they are
BeginUpdateResource, EndUpdateResource and UpdateResource. The "best"
solution would be that RDS links exw.exe with a generic icon, then with a
careful examination of the file determine the offset of the icon data and
overwrite it with your custom icon.

[Spanish]
Si necesitas ayuda y tienes problemas con el idioma escribeme a
daber at pair.com en espa=F1ol, pero porfavor no uses palabras como
"ordenadores" ni de "ficheros".
[/Spanish]

Regards from Chile,
        Daniel Berstein
        daber at pair.com

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

3. Re: 15 Puzzle and questions

>
>>A method to comment large code blocks.
>
>Like Pascal's (* *) or C's /* */? mmmhhh... maybe /-- --/?
>
>> A "if 0 then" is not a good method,
>>since the syntax is checked.
>
>I don't understand.
>
Trying to develop code within /-- --/ allows the growing code to be
syntactically incorrect until it's finished, ie this doesn't work ( in
;

if false then
  AddChar(c)
  hash = ????(hash,c)  <<-- Add name of hash function later
end if

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

4. Re: 15 Puzzle and questions

Hello Rodolfo,


>Suggestions:
>
>A method to comment large code blocks. A "if 0 then" is not a good
method,
>since the syntax is checked.

Right, Euphoria makes a complete pass through the code checking for any
major errors before executing anything.  Of course you COULD put one
huge coment one one line if you don't word wrap but that kind of defeats
the purpose of coments ;)


>The scope rules are prone to collisions of identificators. The not
declared
>libraries do not have to be accessible.
>
>Less important: direct functions reference. Sentences of the type "if
>message_box(...) then end if" or "x = message_box(...)" are artificial.

Do you mean "identical"?  They both do the same thing but using an if
statement to get arround using a variable is generally thought of as
"bad" programing technique.

>Win32Lib:
>
>How it can be changed the icon of a program?

Don't know.

>It can be changed the mouse pointer shape?

I believe there is a library called "mighty.e" that many use for mouse
routines.  It has a standard set of predifined (I believe) pointer types
that you can use.  I'm working on a mouse library now that allows for
customized mouse pointers.  It will have it's limitations but I'm
designing it for "ease of use".  I also plan to add an editor s anyone
can design their own custom mouse shape.  I think I'll release the alpha
version tomorrow with out the editor.


>Are there any method for knowing the dimensions of a bitmap loaded from
>disk?

-- Untested code
include image.e
object bm, height, width
bm = read_bitmap ("c:\path\file.bmp")
height = length (bm [2])
-- assuming that all rows have the same
-- number of pixels.
width = length (bm [2][1])


hope this helps,
Lewis Townsend
Keroltarr at hotmail.com

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

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

5. Re: 15 Puzzle and questions

Hello, Lewis.

>>Less important: direct functions reference. Sentences of the type "if
>>message_box(...) then end if" or "x = message_box(...)" are artificial.
>
>Do you mean "identical"?  They both do the same thing but using an if
>statement to get arround using a variable is generally thought of as
>"bad" programing technique.

What I meant is I would like to write simply "message_box(...)", in spite of
be a function.

>>It can be changed the mouse pointer shape?
>
>I believe there is a library called "mighty.e" that many use for mouse
...

Thanks by your help, but I was referring to the Win32 platform.

>>Are there any method for knowing the dimensions of a bitmap loaded from
>>disk?
>
>-- Untested code
>include image.e
...

Thanks again, but... the same.


Rodolfo Valeiras

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

Search



Quick Links

User menu

Not signed in.

Misc Menu