Some questions about Pixilang

Pixilang programming language
brainmaster
Posts: 15
Joined: Thu Nov 22, 2007 1:32 pm
Location: The land of Colombian coffee

Some questions about Pixilang

Post by brainmaster »

Hi, I used since 2 days ago the Pixilang compiler, and I have some question, maybe you have the answer of those.
  • ✔ I can do compile my PixDemo in a EXE? (I actually package it with WinRAR SFX)
    ✔ Exist some "commandline", that indique to Pixilang don't show the Window Border?
    ✔ I can modify a WindowTitle?
    ✔ Exist some Command to modificate window's size?
    ✔ Maybe exist more examples? (In english webs)
So, additionally I've a suggestion. The random funtion maybe don't work very well. When I open Pixilang first time, the random value is the same(every first time is the same). Only change when I recompile without close the mainprogram.

This is my code (yes I know the is very primitive, but...), maybe is it that has a error, I don't know.

Code: Select all

//definiciones inciales
r=rand & 255
a=rand & 255
v=rand & 255
color=get_color(r,v,a) //obtiene el color de los valores anteriores
b=color
rf=r-255
rf=-1*rf
vf=v-255
vf=-1*vf
af=a-255
af=-1*af
fondo=get_color(rf,vf,af)
clear(fondo)
//pinta caml
inicio:
caml="
b.b.b.b.b
"//fabrica el pixi anterior
pixiini:
make_pixi(caml)
pixi(caml)
print("Cualquier cosa",-25,-90,color)
print("Cualquier cosa dos",-130,85,color)
frame
Ok, I think that its are very well.

Bye
:idea: BrainMaster :idea:
User avatar
NightRadio
Site Admin
Posts: 3944
Joined: Fri Jan 23, 2004 12:28 am
Location: Ekaterinburg. Russia
Contact:

Re: Some questions about Pixilang

Post by NightRadio »

Hello!

ok. answers are below:
1) No, sorry, at the moment you can't make standalone EXE file. At least you need two files: pixilang.exe and boot.txt.
2) Pixilang has no any specific command-line options for changing some window-parameters. But, i think, this will be in the next release.
3,4) please, see answer 2 :)
5) Now there are not so many examples... The most of them are in archive with Pixilang. And some other are on russian blog.
About random generator. You need to use command rand_seed() - it's something like starting point for random generation.
Example:
rand_seed( 123 )
a = rand //At this point random number in "a" variable will be same always.

Thank you for questions
brainmaster
Posts: 15
Joined: Thu Nov 22, 2007 1:32 pm
Location: The land of Colombian coffee

Re: Some questions about Pixilang

Post by brainmaster »

Hi, I tried but the command rand_seed() by itself don't give a random number. So I implement the next solution, is a very improbabily generate two identical random numbers in a time interval of one hour, with this mecanism :wink: .

Code: Select all

ss=get_seconds
sh=get_hours
sm=get_minutes
su=ss+sm/sh
rand_seed(su)
Maybe it can more variable including a extensive operation how: (((ss+sm)/sh)*(ss+sm/sh)*(ss/sh+sm))/sh :mrgreen:

So the first work very good. Thanks for the tip of "rand_send" and I apologize for write in this forum about Pixilang, the problem is that I cannot enter to the Pixilang's subforum.

P.D. Maybe I have problems with a 0 hours, Pixilang how write the midnight hours?

Bye and good neuronal signals.
:idea: BrainMaster :idea:
User avatar
NightRadio
Site Admin
Posts: 3944
Joined: Fri Jan 23, 2004 12:28 am
Location: Ekaterinburg. Russia
Contact:

Re: Some questions about Pixilang

Post by NightRadio »

Hello again!
Hm.. but rand_seed() is not a command for random number generation :) Below is another example:

Code: Select all

rand_seed( 0 ) //Start random generation from point 0
a1 = rand //move some random number to "a1"
rand_seed( 0 ) //Start random generation again from the same point
a2 = rand
//Now a1 is equal to a2
J3d1
Posts: 175
Joined: Wed Oct 15, 2008 4:49 am
Location: г. Абакан, Хакасия
Contact:

Re: Some questions about Pixilang

Post by J3d1 »

Приветствую, NightRadio! Хороший язык программирования! Только треугольник висит
Last edited by J3d1 on Tue Oct 21, 2008 4:50 pm, edited 2 times in total.
User avatar
NightRadio
Site Admin
Posts: 3944
Joined: Fri Jan 23, 2004 12:28 am
Location: Ekaterinburg. Russia
Contact:

Re: Some questions about Pixilang

Post by NightRadio »

:) Хай!
А что значит "нельзя убрать треугольник"?
Командную строку должен поддерживать :)
Компиляции пока никакой нет. То есть, чтобы запустить прогу, нужно иметь её исходник в TXT-формате.. Возможно, в будущих версиях что-нибудь в этом плане изменится.
J3d1
Posts: 175
Joined: Wed Oct 15, 2008 4:49 am
Location: г. Абакан, Хакасия
Contact:

Re: Some questions about Pixilang

Post by J3d1 »

Привет! На КПК в углу висит
Last edited by J3d1 on Tue Oct 21, 2008 4:50 pm, edited 2 times in total.
User avatar
NightRadio
Site Admin
Posts: 3944
Joined: Fri Jan 23, 2004 12:28 am
Location: Ekaterinburg. Russia
Contact:

Re: Some questions about Pixilang

Post by NightRadio »

А.. понял :) К сожалению, на КПК он не убирается и висит на тот случай, если пользователю нужна виртуальная клава, или он забыл реализовать выход из программы. Но я учту пожелание и сделаю команду для удаления этой кнопки :)
Графический редактор - это хорошо :) Для таких вещей Пикси действительно подходит лучше, чем более навороченные языки.
J3d1
Posts: 175
Joined: Wed Oct 15, 2008 4:49 am
Location: г. Абакан, Хакасия
Contact:

Re: Some questions about Pixilang

Post by J3d1 »

Hi! Спасибо за разъяснение!
Last edited by J3d1 on Tue Oct 21, 2008 4:47 pm, edited 1 time in total.
J3d1
Posts: 175
Joined: Wed Oct 15, 2008 4:49 am
Location: г. Абакан, Хакасия
Contact:

Re: Some questions about Pixilang

Post by J3d1 »

Привет, вопрос снят.
Last edited by J3d1 on Tue Oct 21, 2008 4:48 pm, edited 1 time in total.
User avatar
Al_Rado
Posts: 239
Joined: Tue Dec 04, 2007 2:33 pm
Location: Krasnodar
Contact:

Re: Some questions about Pixilang

Post by Al_Rado »

Графический редактор для КПК - как это знакомо )
J3d1 посмотри в архиве программ "examples", там три разных имеется, полезные фишки найти реально ) Да и Zuf тут где-то приводил алгоритм рисования линиями
ВекторКодПиксельПолигон - ВотЧтоЯЛюблю!
J3d1
Posts: 175
Joined: Wed Oct 15, 2008 4:49 am
Location: г. Абакан, Хакасия
Contact:

Re: Some questions about Pixilang

Post by J3d1 »

Привет! Спасибо за подсказку, я этот раздел не заметил с ходу, каюсь. Сейчас посмотрю. Да кодить буду выходные.
Last edited by J3d1 on Tue Oct 21, 2008 4:49 pm, edited 1 time in total.
J3d1
Posts: 175
Joined: Wed Oct 15, 2008 4:49 am
Location: г. Абакан, Хакасия
Contact:

Re: Some questions about Pixilang

Post by J3d1 »

Оказывается Pixilang в операторе if не может сравнивать строковые переменные. Ровно 2 часа экспериментов перед тем как я это понял :)
User avatar
NightRadio
Site Admin
Posts: 3944
Joined: Fri Jan 23, 2004 12:28 am
Location: Ekaterinburg. Russia
Contact:

Re: Some questions about Pixilang

Post by NightRadio »

Увы :) В Pixilang каждая переменная содержит только число. А в случае со строками, числа - номера пикси-контейнеров, содержащих строки.
Например:
a = "hello"
b = "world"
теперь a = 1 и b = 2. то есть, пикси-контейнер с номером 1 содержит строку "hello", а с номером 2 - строку "world".
соответственно сравнение if a > b равноценно вот такому: if 1 > 2
J3d1
Posts: 175
Joined: Wed Oct 15, 2008 4:49 am
Location: г. Абакан, Хакасия
Contact:

Re: Some questions about Pixilang

Post by J3d1 »

Теперь понятно )
Post Reply