Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3312010
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T21:56:37+00:00 2026-05-17T21:56:37+00:00

Using Rebol/View 2.7.7, I’m trying to create a card game based on Nick’s Rebol

  • 0

Using Rebol/View 2.7.7, I’m trying to create a card game based on Nick’s Rebol tutorial at: http://re-bol.com/rebol.html#section-10.18. What I want to do though is read the cards from the binary file Nick created, discard some of the data, and use it to layout a tableau of cards, 4 rows of 3 columns, with the 2 center card locations not used.

Here’s my code:

protect-system

random/seed now

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

the-tableau: [
 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 []
lay: layout the-tableau
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 lay

do-events

But this doesn’t show the cards at all. I’m not even sure it’s reading the correctly? Where is the problem?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T21:56:38+00:00Added an answer on May 17, 2026 at 9:56 pm

    Actually you didn’t use the random-card function in your for loop at the end… 🙂

    foreach c lc [get c set-face get c random-card ]
    

    You note that you are not sure if data was loaded correctly…

    here is a simple way to find out… just print/probe the TYPE? of that data

    dimg: load to-binary decompress (card)
    probe type? dimg
    

    In this case it will print out image! in the console… so yep… that’s working. 🙂

    As an added little detail, I noticed you didn’t compensate your random for the “back face” image in the card data (which is at its end), so the random-card function should be fixed like so:

    random-card: does [pick deck-cards random (length? deck-cards) - 1] ; - 1 since we don't want the back face to be picked.
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using Google Maps InfoBox - http://google-maps-utility-library-v3.googlecode.com/svn/trunk/infobox/docs/reference.html Currently the map will scroll - pan control
using (var client = new WebClient()) { client.DownloadFile(new Uri(@http://www.bilyoner.com/iddaa/iddaa-liste),path); } } I am trying
(using VS 2010) I'm new to WPF and am trying to create a TreeViewItem
Using this code snippet: https://gist.github.com/1854699 . I have written this code Base.html: https://gist.github.com/3438843 index.html:
Using the data.table package in R, I am trying to create a cartesian product
Using the http://www.ifans.com/forums/showthread.php?t=132024 post from another question i am allowing the user to enter
Using jQuery UI Resizable I'm trying to prevent resizing based on various rules. The
using this http://bl.ocks.org/950642 we can see how to add images to nodes, the question
I Would like the get the filesize of a remote file using Rebol, in
Using linq2sql I'm trying to take the string in txtOilChange and update the oilChange

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.