Entraides et échanges autour de la technologie Scol - Informations and exchanges on the Scol technology
Vous pouvez changer la langue de l'interface une fois inscrit - You can change the language once registered
You are not logged in.
Hi All !
Scol and Openspace3D continue to grow. They are improving with more and more features. This is great news for the longevity of the project and for the entire users community !
Have a fun day,
Iri
Hi !
Several errors in your code.
You should never compare floats in this way, in Scol nor any other language.
To compare two integers, it's ok :
if integer1 == integer2 then
...
To compare two floats, you compare the difference with an epsilon whose accuracy you arbitrarily choose.
if (float1 -. float2) <. epsilon then
_fooS "they are equals"
else
_fooS "They are not equals";
You should use the float Scol library : http://redmine.scolring.org/projects/li … float.html (doc)
Your code could be this in h/a.pkg :
fun main()=
_showconsole;
let atof "$9" -> x in
let " " -> temp_x in
if std_fCmp x (-.255.0) then
set temp_x = ftoa (-.1.0)
else
set temp_x = ftoa 0.0;;
Called by a such script :
_load "lib/std/float.pkg"
_load "h/a.pkg"
main
I use std_fCmp function. By default, epsilon is 0.000001.
You write :
if x =. -255.0 then
Also, = sets a value to a variable, so if x = 255.0 then sets 255.0 to x and the expression tests the return value of set, a side effect. This is an equivalent of if set x = 255.0 then ...
if x =. 255.0 then, with a point, create a syntax error : this is no sense in Scol. It's contrary to its grammar.
In a test, you must double the equal sign but with the float numbers, this is wrong (see above).
Next, -255.0 is wrong. Indeed, - (without point) expects an integer.
-. (with point) expects an float, thus (-.255.0) is correct.
If you want compare an integer and a flot, you must convert the integer to float (or the other way around but your can lost the precision)
Then, your variable named x is stange :
let atof "$9" -> x in
will always give 0.000000. I guess you wish to get the value of $9, maybe a parameter into a string ?
scol throws an error, I assume because I am adding an element that comes after the end of the tail of the list, which is nil.
Yes.
I'm also curious as to what:
Expected: fun [[[r1 r1] r1] [r1 r1] I] [r1 r1]
The compiler is too crazy sometimes ...
[r1 r1] does not exist. It's senseless.
A recursivity level 2 can be exist (even level n but this is no utility in practice). By example : [S I r2]
To add an element at the end, you can see in 'lib/std/list.pkg' : there is not function for that but std_lApplyFunc could be a start.
Hello !
proto build_line_return_string = fun[[S r1] I I S] S;;
proto make_string_list = fun [S [S r1] I ] [S r1];;
fun make_string_list(element, list, iterations) =
let 0 -> counter in
while (counter < iterations) do
(
set list = element::list;
++counter;
);
list;;
fun build_line_return_string (list, multiplier, counter, output_string)=
//end of list, return full string
if ((hd list) == nil) then
output_string
//not end of list yet
else
if ((mod counter multiplier) == 0) then
(
//add head of list to end of string, add line return since we are at a multiple of multiplier that
//determines line length and
//feed tail of list and changed string back into function
set output_string = strcatn output_string::(hd list):: "\n"::nil;
++counter;
build_line_return_string tl list multiplier counter output_string;
)
else
(
//add head of list to end of string followed by a space, feed tail of list
//and changed string back into function
set output_string = strcatn output_string::(hd list)::" "::nil;
++counter;
build_line_return_string tl list multiplier counter output_string;
);;
fun main()=
_showconsole;
let 100 -> iterations in
let make_string_list "vv" nil iterations -> string_list in
_fooS build_line_return_string string_list 7 1 nil;
0;;
I just add few very minor changes. To be continued ...
I don't know what you want to do next...
you can try to write a more polymorphic package: for example, a list of any objects with a tuple of coordinates instead of string ? Or not ! Cool to see you again
No.
Hi,
An OS3D's app or a Scol's app ?
http://redmine.scolring.org/ is a better choice.
Or go to the the Scolring home page (www.scolring.org) then click on "Development server"
If this is only an OS3D's applet, but if this is an application written in Scol (that was the question), the source code must be provided.
Same thing for Scol itself.
yes
and you must freely provide the source code of your Scol's app.
For more informations, see the license file
You can sell it for any price if you have buyers.
Great
Hi,
You can't with this plugin.
Nota : I moved your last threads from "Programing" to "OpenSpace3D"
Hohoo, cool )
Outre une vidéo, je serais curieux de voir ce que tu as fait, tant dans les modifs d'OS3D que dans la prog de la carte Arduino. Publieras-tu sur ces sujets ?
Hi,
They remain a security issue. I never liked this. But it can be convenient
C'est assez caractéristique d'un encodage mal pris en charge ? Comme évoqué, tester avec des vidéos sous un autre encodage.
Yes, great job
Bonjour,
et ne pas hésiter à en parler autour de vous ! ;-)
Hello !
Happy and prosperous new year !
New projects, new apps, new news ...
Have phun !
Cool !! )
Cool
Your code is correct.
Several different ways exist for this. Here, i use functions and sprintf :
fun getZeroIfAny (iData)=
strcat if iData < 10 then "0" else "" itoa iData;;
fun getOnly3d ()=
if only3d then ".png.jpg" else ".jpg";;
fun cbTakeShot (inst, from, action, param, rep, p) =
...
let sprintf "%s%d%s%s_%s%s%s%s"
[filePrefix // %s
year // %d
getZeroIfAny month // %s
getZeroIfAny day // %s
getZeroIfAny hours // %s
getZeroIfAny minutes // %s
getZeroIfAny seconds // %s
getOnly3d] // %s
-> file in
...
It may be more readable but this is subjective.
(i don't check its validity, it might be easily adapted)
Well
Hi,
At this time, no.
This is probably related to the error under Wine
Hi,
8 Go ! You did not install a copy of the source code (by subversion by example) ? Only the "setup" ?