Hello, writing to the list for more feedback
On 28-Dec-99, Andrew wrote:
> Hi, Elliott! You wrote:
>> (FYI, it'll be a Shadowrun character generator)
>
> I'm interested in having a look at this, Elliot.
>
> Is there any chance of this, please?
OK, here's my first 2 attempted starts, I think the second looks a little
cleaner.
When I run the script, I find that 'priorities is missing an item. Is this
a problem with my usage of remove? I'm trying to remove the value found in
'priorities/magic from the list of available priorities 'pri-list. The
same procedure is working for 'priorities/race, but somewhere I'm losing
'priorities/magic as a block item of 'priorities.
What's going wrong?
>> do %/zip0/rpg/srun/srcg2.r
Script: "Shadowrun Character Generator" (29-Dec-1999)
Shadowrun Character Generator
This script makes the following assumptions:
1. Race: if not a metahuman (priority A), priority will be set to E
2. Magic: if not a mage or adept, priority will be set to D or E
What is the character's race (human, elf, dwarf, ork, troll)? human
Is this a mage or adept (mage, adept, none)? mage
** Script Error: Invalid path value: magic.
** Where: priorities/magic: first pri-list
>> priorities
== [
race "e"
atributes
skills
resource
]
>>
Elliott
REBOL [
Title: "Shadowrun Character Generator"
Date: 29-Dec-1999
File: %srcg.r
Version: 0.0.1
Author: "Elliott Olson"
Email: [EMAIL PROTECTED]
Home: http://www.qsl.net/n0ukf/
Language: 'English
Purpose: {
Automates the rules for generating a Shadowrun (tm FASA) character
thus helping the player to create a character's stats.
}
Comment: {
This script makes the following assumptions:
1. Race: if not a metahuman (priority A), priority will be set to E
2. Magic: if not a mage or adept, priority will be set to D or E
}
History: [
0.0.1 [29-Nov-1999 "Started this script" "Elliott"]
]
Example: {Show how to use it.}
]
print { Shadowrun Character Generator
This script makes the following assumptions:
1. Race: if not a metahuman (priority A), priority will be set to E
2. Magic: if not a mage or adept, priority will be set to D or E
}
a: ["Metahuman" "Human Magician" 30 40 1000000 50]
b: ["Human" ["Human Adept" "Metahuman Magician"] 24 30 [400000 35]]
c: ["Human" "Metahuman Adept" 20 24 90000 25]
d: ["Human" "--" 17 20 5000 15]
e: ["Human" "--" 15 17 500 5]
races: ["human" "elf" "dwarf" "ork" "troll"]
priorities: [
race
magic
atributes
skills
resource
]
until [
ch-race: to-string ask "What is the character's race (human, elf, dwarf, ork,
troll)? "
if find races ch-race [true]
]
either ch-race = "human" [priorities/race: "e"] [priorities/race: "a"]
mage: to-string ask "Is this a mage or adept (mage, adept, none)? "
if (mage = "mage") and (priorities/race = "a") [priorities/magic: "b"]
if (mage = "mage") and (not priorities/race = "a") [priorities/magic: "a"]
if (mage = "adept") and (priorities/race = "a") [priorities/magic: "c"]
if (mage = "adept") and (not priorities/race = "a") [priorities/magic: "b"]
if (mage = "none") and (priorities/race = "e") [priorities/magic: "d"]
if (mage = "none") and (not priorities/race = "e") [priorities/magic: "e"]
comment [ notes and code fragments
;find order or position of element
;>>foo: [a b c d e]
;== [a b c d e]
;>>index? find foo 'b
;== 2
;prechar: [e d a b c]
]
REBOL [
Title: "Shadowrun Character Generator"
Date: 29-Dec-1999
File: %srcg2.r
Version: 0.1.0
Author: "Elliott Olson"
Email: [EMAIL PROTECTED]
Home: http://www.qsl.net/n0ukf/
Language: 'English
Purpose: {
Automates the rules for generating a Shadowrun (tm FASA) character
thus helping the player to create a character's stats.
}
Comment: {
This script makes the following assumptions:
1. Race: if not a metahuman (priority A), priority will be set to E
2. Magic: if not a mage or adept, priority will be set to D or E
}
History: [
0.0.1 [29-Nov-1999 "Started this script" "Elliott"]
0.1.0 [30-Nov-1999 "rewrite" "Elliott"]
]
Example: {Show how to use it.}
]
print { Shadowrun Character Generator
This script makes the following assumptions:
1. Race: if not a metahuman (priority A), priority will be set to E
2. Magic: if not a mage or adept, priority will be set to D or E
}
pri-list: ["a" "b" "c" "d" "e"]
;a: ["Metahuman" "Human Magician" 30 40 1000000 50]
;b: ["Human" ["Human Adept" "Metahuman Magician"] 24 30 [400000 35]]
;c: ["Human" "Metahuman Adept" 20 24 90000 25]
;d: ["Human" "--" 17 20 5000 15]
;e: ["Human" "--" 15 17 500 5]
races: ["human" "elf" "dwarf" "ork" "troll"]
priorities: [
race
magic
atributes
skills
resource
]
until [
ch-race: to-string ask "What is the character's race (human, elf, dwarf, ork,
troll)? "
if find races ch-race [true]
]
either ch-race = "human" [priorities/race: "e"] [priorities/race: "a"]
remove pri-list :priorities/race
mage: to-string ask "Is this a mage or adept (mage, adept, none)? "
if (mage = "mage") [priorities/magic: first pri-list]
if (mage = "adept") [priorities/magic: second pri-list]
if (mage = "none") [priorities/magic: last pri-list]
remove pri-list :priorities/magic
comment [ notes and code fragments
;some initial assignments above may be unnecessary
;find order or position of element
;>>foo: [a b c d e]
;== [a b c d e]
;>>index? find foo 'b
;== 2
;prechar: [e d a b c]
]