r3wp [groups: 83 posts: 189283]
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r3wp

[I'm new] Ask any question, and a helpful person will try to answer.

Gregg
2-Aug-2010
[3868]
Yes, I used a dash as a dash, knowing that meant the cell was empty. 
I think post-processing is the way to go.
Maxim
2-Aug-2010
[3869]
especially since all it needs is a replace/all  :-)
Gregg
2-Aug-2010
[3870]
Between a WRITE and a READ. :-)
Maxim
2-Aug-2010
[3871]
details  ;-)
Anton
2-Aug-2010
[3872x4]
I haven't used make-doc for a long while, but maybe you can insert 
HTML's  
Then there's ascii char 160, which you can generate in rebol with 
to-char 160. I think they call it a 'hard space' or something.
Once you get it into your editor, you can just copy and paste it 
to all those blank cells. That should probably work.
Ah but wait, it probably depends what Excel will do with it.
Gregg
2-Aug-2010
[3876]
160 = nbsp. I don't know what Excel would do with it either.
Chris
3-Aug-2010
[3877]
You could try:

\group

/group
Yuri
14-Aug-2010
[3878x2]
Privet, ljuboj russkij programmistov zdes'?
Moj anglijskij ne ochen' horosho.
Gregg
15-Aug-2010
[3880]
I don't know if anyone speaks Russian here Yuri.
Oldes
15-Aug-2010
[3881]
Zdrastvuj Yuri:)
Pekr
15-Aug-2010
[3882]
Yuri - ja ucilsja ruskij jazyk, no ja negovorju po ruski aktivno 
:-)
Gregg
15-Aug-2010
[3883]
I stand corrected. :-)
Yuri
15-Aug-2010
[3884]
Good afternoon Oldes and Pekr. My English not good. I use translation 
on Internet. I apologetic if software not judicious
Yuri
17-Aug-2010
[3885]
I apologetic if software not judicious
 -- Hilarious
Good luck all, over and out.
RobertS
20-Aug-2010
[3886]
My Russian is pretty basic ... but sometimes OK for chat as I read 
more than speak .. gets me by listening to Serb and Czech films (no 
ethno -lingual flames, SVP :-)   Polish should come next once I settle 
in here  ( also relatively easy for IT chat )
BrianH
20-Aug-2010
[3887]
Don't worry, it was a fake account.
florin
28-Aug-2010
[3888x2]
What is the issue! datatype? A release? A specification? A problem?
I found this #do reading some code. What is it mean, the Word Browser 
does not anything in it.
BrianH
29-Aug-2010
[3890x2]
The issue! type is a string type that is used for special purposes. 
One of those pruposes is a preprocessor script called prebol, which 
is used by the SDK. If you saw #do in a script it is likely a prebol 
directive.
The docs for prebol are here: http://www.rebol.com/docs/sdk/prebol.html
florin
29-Aug-2010
[3892]
Thanks. That was helpful.
srwill
1-Nov-2010
[3893]
Hi. So is this the correct group to ask a codingn question?
Pekr
1-Nov-2010
[3894]
sure :-)
srwill
1-Nov-2010
[3895x2]
I''m trying to understand this language, sometimes getting it, sometimes 
not. Anyway here's my question.

In VID, I have a layout.  I want to put random images in 3 columns 
with 5 rows.  The images are stored together in a single binary file. 
(this is a mod of the card game on Nick's tutorial site).


So I read in the images into a series,  after I set the layout. But 
how do add those to the layout?

Here's my current code:
do %cards.r

the-tableau: layout [
	size 320x480 backdrop 0.170.0
	across
	at 30x20 tc1: box 80x100 teal 
	tc2: box 80x100 teal 
	tc3: box 80x100 teal return
	at 30x130 tc4: box 80x100 teal
	tc100: box 80x100 coal
	tc5: box 80x100 teal return
	at 30x240 tc6: box 80x100 teal
	tc200: box 80x100 coal
	tc7: box 80x100 teal return
	at 30x350 tc8: box 80x100 teal
	tc9: box 80x100 teal
	tc10: box 80x100 teal
]

foreach [card label num color pos] cards [
	
	dimg: load to-binary decompress (card)
	append deck-cards dimg ;feel movestyle
	throw-away-label: label
	append deck-cards-num num
	append deck-cards-color color
	throw-away-pos: pos
]

view/new the-tableau

do-events
i want to replace each of the boxes in the layout with a random image 
from deck-cards.
Carl
1-Nov-2010
[3897x4]
at top of layout block, add:

  style card image 80x100 teal

Then each card can be:

   tc1: card
   tc2: card

etc.
then:

   foreach c [tc1 tc2 tc3 ...] [set-face get c random-card]
random-card: does [pick card-images random length? card-images]

Of course, this assumes it is ok to have 2 of the same cards. ;)
I hope that helps. There are many experts around who can give you 
other tips!
srwill
1-Nov-2010
[3901]
That does help, thanks!  But still having some trouble seeing what's 
going on.

I see what random-card does, I think.  length? card-images returns 
how many are in the series of card-images.  Then random returns a 
number based on length?.  And pick chooses one of the card-images 
based on the random number.


But what is happening in the foreach?  It iterates over the images 
in the layout, correct?  The c is just an arbitrary variable, it 
could be anything, right?
Maxim
1-Nov-2010
[3902x3]
hehe carl pulled an advanced trick on you  :-)
C is being assigned the word, not its value.  (like if you where 
iterating variable names, not variable's values) 

get then extracts that word's value
in REBOL all functions return a value, even if you do not use the 
return word (its actually better not to use return explicitely, since 
its faster)


so the random-card function returns an image!  from the card-images 
block.


the set-face function applies the image to its default meaning for 
that style.
srwill
1-Nov-2010
[3905x2]
ok.  I think I understand that.  So here's my new code, which doesn't 
work.
random/seed now

;--include the binary card data
do %cards.r

the-tableau: layout [
	size 320x480 backdrop 0.170.0
	style tabstyle image 80x100 teal
	style holdplace box 80x100 coal
	across
	at 30x20 tc1: tabstyle
	tc2: tabstyle 
	tc3: tabstyle return
	at 30x130 tc4: tabstyle
	tc100: holdplace
	tc5: tabstyle return
	at 30x240 tc6: tabstyle
	tc200: holdplace
	tc7: tabstyle return
	at 30x350 tc8: tabstyle
	tc9: tabstyle
	tc10: tabstyle
]

lc: copy []
lc: [tc1 tc2 tc3 tc4 tc5 tc6 tc7 tc8 tc9 tc10]

deck-cards: copy [] 	; The deck holds all of the cards from the binary 
file
deck-cards-num: copy []
deck-cards-color: copy []

foreach [card label num color pos] cards [
	
	dimg: load to-binary decompress (card)
	append deck-cards dimg ;feel movestyle
	throw-away-label: label
	append deck-cards-num num
	append deck-cards-color color
	throw-away-pos: pos
]

random-card: does [pick deck-cards random length? deck-cards]
foreach c lc [set-face get c deck-cards]

view/new the-tableau

do-events
The plan was to read  card at random into a block called the-deck, 
then remove them one at a time, and add them to another block called 
the-tableau.
Maxim
1-Nov-2010
[3907x2]
I've got important work to do right now, but if you can wait, I can 
give you a working solution later.
if you're on stack overflow, I'd even prefer you repost your question 
there, since Its going to be on the open web and I can post pictures.
Steeve
1-Nov-2010
[3909]
And you will increase your rank for free Maxim ? ;-)
Maxim
1-Nov-2010
[3910x2]
hahahhaa.
I still need to put the time to answer him  ;-)
Steeve
1-Nov-2010
[3912x2]
srwill, Try to postpone the foreach statement in your code.

lay: layout the-tableau
foreach c lc [set-face get c deck-cards]
view lay
btw, using "the-tableau" , Are you from the French connection somehow 
?
srwill
1-Nov-2010
[3914]
No, tableau is a term I seem to recall from an old According to Hoyle 
card rules book, meaning the layout of the cards to be played.
Steeve
1-Nov-2010
[3915]
Yeah but still, it's French.
It's like doing your coming out :-)
Ladislav
1-Nov-2010
[3916]
Rien ne va plus!
srwill
1-Nov-2010
[3917]
I had French in HS... couple semesters in college... Can't read that. 
 I do have great admiration for the French, though.