• Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r4wp

[Ann-Reply] Reply to Announce group

GrahamC
2-Jul-2012
[131]
Rebol2 has a pretty straight forward case construct
Rebolek
2-Jul-2012
[132]
you can use something like this:
case [
	n < 9 do-something
	n < 17 do-something-else
	n < 25 do-something-different
]
GrahamC
2-Jul-2012
[133x3]
From the docs:

num: 10000
case [
    num < 10 [print "small"]
    num < 100 [print "medium"]
    num < 1000 [print "large"] 
    true [print "huge"]
]
huge
http://www.rebol.com/r3/docs/functions/case.html
and switch is useful as it allows multiple tests

>> print switch 1 [ 2 1 [ "yes" ] 3 [ "no" ]]
yes
Maxim
2-Jul-2012
[136x2]
mirror is MUCH more fun now that the numbers on the edge react in 
real time.... really makes it one big step more playable.

its also much more obvious what the game is about.
it would also be much easier to help and add features if all the 
code where in english  ;-)
Kaj
3-Jul-2012
[138]
Not for Dutch kids :-)
Maxim
3-Jul-2012
[139]
got most of it understandable using google translate   :-)
Arnold
3-Jul-2012
[140]
This is the benefit of speaking another language than English that 
is the base for so many computerlanguages. You can say things like 
rij: array [100] where array: array [100] would be a sure syntax 
error, and rij means array in Dutch off course. If you are in need 
of additional translations, just say so. Next I will build a multi-lang 
support lbl-something/text: lbl-something-tekst and a preferences 
panel with file (mirror.ini or mirror-pref.ini) for language (En 
De Nl Fr Es Pt additional wishes?), mirror line-width normal(1)/bold(3 
wide) for placed or both kinds and/or the grid, color of added mirrors, 
color for ok color for not ok.
Maxim
3-Jul-2012
[141x2]
I'm adding a visual and interactive mirror tracing layer so that 
you can just hover over the numbers and they shoot a visible ray 
across the grid   :-)
(bouncing off the mirrors obviously)
Arnold
3-Jul-2012
[143]
Is yours also workig on android and iPhone yet? :)))
Maxim
3-Jul-2012
[144x2]
hehe  I wish  ;-)
I'm still working on figuring out the grid walking function... nice 
trick using xor and direction bits btw.
Arnold
3-Jul-2012
[146x2]
Thanks, when I did the trick in my Java applet I had never expected 
to use XOR at all ever. In Java I had an field of 10by10. I'll explain 
a little. Starting top left having an initial direction south start 
on the first field of the grid. determine the next direction to go 
then step and repeat until you step of the board stap=step r row, 
k for column (kolom) so stapr or stapk will be 0 or 9. then you are 
on the other end of the board. the values along the board is a series 
of 32 elements going clockwise around the board. Go to the next field 
clockwise when right your init direction is west etc.
When determining the values around the board you skip the ones that 
already have a value.
Maxim
3-Jul-2012
[148x3]
yeah, I'm pretty close to getting it ,  right now I'm adapting the 
function which returns the current row-column based on the position, 
since I need it to handle position outside the edge of the grid-box. 
 then I'll have the initial cell to use to start "walking" the grid.


in the end, I'll just add a refinement to the function which does 
the waking so it returns a block of all the tiles is crossed and 
an indication of what edges it came in and out of (to make it easier 
to loop and draw).
(right now = last I played... right now I'm at work, and can't play 
with this directly)
;-)
Arnold
3-Jul-2012
[151x2]
Having the 3 layers on top of each other was a nice REBOL feature 
saving a little time redrawing the grid and other mirrors as was 
necessary in Java (well I am not an experienced Java programmer, 
so it was necessary for me to solve it like that)
Somewhere I have read that someone had a problem with a similar drawing 
trick, can't remember where unfortunately, but it made me fear this 
trick might be impossible. Luckely it did work like I implemented 
it right on the first try..
Arnold
4-Jul-2012
[153]
Don't you hate that about work?
Maxim
4-Jul-2012
[154]
hehe
Arnold
5-Jul-2012
[155x5]
I have seen that one before
Try
lbl-language-text: "en"
It really should say " Choose your language here" or somthing

Was your mirror-lang.r loaded properly? the next error would be  
lbl-mirror-color-text .
That prediction was correct. Now diving in to find what was already 
loaded when building this, just like last time. Hang in there!
This one is tricky lots of prints now.
Fixed it but now the ****really bad words**** radio buttons are protesting 
again D:
Arnold
6-Jul-2012
[160]
It works now, and I made the files .rebol extension again.
DocKimbel
8-Jul-2012
[161]
@Marco: great work!
Arnold
8-Jul-2012
[162]
Blowing on the whistle ;-) It's Win only because the RepRap is Win 
only.
Henrik
8-Jul-2012
[163]
Marco, very nice.
Kaj
8-Jul-2012
[164x3]
Very cool. We have been looking into doing something with the RepRap, 
preferably with Red
RepRap is not Windows only. Most of the software is developed on 
Java and Eclipse for Linux and Windows, with some versions available 
for Mac
Marco, what's tying RebRap to Windows? The serial port communication 
maybe?
Gregg
8-Jul-2012
[167]
Very cool Marco!
Kaj
9-Jul-2012
[168]
Congratulations, Jerry
Jerry
9-Jul-2012
[169]
Thanks. Kaj. I always thought that I should do something for the 
REBOL community. But in REBOL programming, I am not as good as any 
one of you. Finally, I found a way to make my contribution -- writing 
a book and trying to make REBOL popular in China.
PeterWood
9-Jul-2012
[170]
Congrtulations, Jerry. Hope the book sells well.
Jerry
9-Jul-2012
[171]
Thanks Peter. I will report the selling status. We should also watch 
the RT web site PageViewNumber from China since next month  http://www4.clustrmaps.com/zh/counter/maps.php?url=http://www.rebol.com
Kaj
9-Jul-2012
[172]
You're right, this is a great contribution
Endo
9-Jul-2012
[173]
Great work Jerry! China is already in top 3 :)
Marco
9-Jul-2012
[174x2]
Congratulations, jerry.

@Kay: RebRep is tied to Windows because I don't have a working linux 
box. I have tried to install Kubuntu 12.04 on an sdcard but it stops 
at the login where I don't know what to write since the most obvious 
"kubuntu" and <return> do not work. I have also tried ubuntu 12.04 
and it works but have a nasty bug configuring audio and seems not 
to regognize all the hardware.
I forgot to reset the beige background of previous message...
Arnold
11-Jul-2012
[176]
I was surprised to find my little project back on this new blog at 
rebol2.blogspot.com I hope this will help to show that there still 
is a bright future for REBOL ahead.
Kaj
11-Jul-2012
[177]
It's nice when a new REBOL user starts doing such a project right 
away :-)
Arnold
11-Jul-2012
[178]
Have you checked the new version yet? Learning a lot of new stuff 
about VID, getting more code out right the first time, etc.
Kaj
11-Jul-2012
[179]
Ehm, sorry, I don't have time
Maxim
11-Jul-2012
[180]
marco really cool