Oracles importation improved.

This commit is contained in:
Offray Vladimir Luna Cárdenas 2021-12-05 13:58:22 -05:00
parent 7c8c897d60
commit 67be117367
5 changed files with 28 additions and 3 deletions

View File

@ -4,4 +4,4 @@ asTiddler
title: self name;
tags: 'Starforged';
text: self introText, String cr, String cr, self optionsWikiTextTable;
created: DateAndTime now asString.
created: Tiddler nowLocal.

View File

@ -0,0 +1,4 @@
accessing
optionColumnNames
self options ifEmpty: [ ^ nil ].
^ self options associations first value keys reversed

View File

@ -8,5 +8,5 @@ optionsFromDictionary: aDictionary
ifFalse: [
prevKey := (aDictionary at: i - 1) at: 'Chance'.
key := prevKey asInteger + 1 to: (opt at: 'Chance') asInteger ].
value := (opt at: 'Description') capitalized.
value := (opt copy removeKey: 'Chance'; yourself).
self options at: key put: value ]

View File

@ -0,0 +1,20 @@
accessing
optionsWikiTextRow: value
| output |
value class = String ifTrue: [ ^ value , '|' ].
output := '' writeStream.
output
nextPutAll: (value at: 'Description'), ' |'.
value keys size > 1 ifTrue: [ | remaining cell |
remaining := value copy removeKey: 'Description'; yourself.
cell := remaining values.
cell class = Array ifTrue: [
cell first doWithIndex: [:each :i |
output nextPutAll: '[[', each asString,']] '.
(i % 2 = 1) ifTrue: [output nextPutAll: '; ' ]
]
].
output nextPutAll: '|'.
].
^ output contents

View File

@ -2,10 +2,11 @@ accessing
optionsWikiTextTable
| output |
output := '' writeStream.
output nextPutAll: String crlf.
self options keysAndValuesDo: [:k :v | | keyString |
keyString := ((k size = 1) ifTrue: [ k first asString ] ifFalse: [ k first asString, ' - ', k last asString ]).
output
nextPutAll: '| ',keyString , ' |';
nextPutAll: v, ' |'; cr
nextPutAll: (self optionsWikiTextRow: v); cr
].
^ output contents