RPG attributes generator: Difference between revisions
Content added Content deleted
ReeceGoding (talk | contribs) m (→{{header|R}}: Syntax highlighting.) |
(→{{header|Commodore BASIC}}: Standardize line numbering; switch to 0-basis for arrays to avoid wasting entries; use chr$ for cursor movement; change DS to DT so it works on C-128 where DS is a reserved word..) |
||
Line 1,212: | Line 1,212: | ||
Except for screen control codes, this is generic enough it could be used for many other 8-bit interpreted BASICs as well. (Applesoft, ZX Spectrum, etc.). Should work on all Commodore models. (Adjustment for screen width may be necessary on VIC-20.) |
Except for screen control codes, this is generic enough it could be used for many other 8-bit interpreted BASICs as well. (Applesoft, ZX Spectrum, etc.). Should work on all Commodore models. (Adjustment for screen width may be necessary on VIC-20.) |
||
<lang gwbasic> |
<lang gwbasic>100 rem rpg character roller |
||
⚫ | |||
10 rem rpg character roller |
|||
⚫ | |||
⚫ | |||
130 dim at(5),at$(5):rem attributes as follows: |
|||
⚫ | |||
105 dim at(6),at$(6):rem attributes as follows: |
|||
150 at$(1)="Dexterity" |
|||
160 at$(2)="Constitution" |
|||
170 at$(3)="Intelligence" |
|||
180 at$(4)="Wisdom" |
|||
190 at$(5)="Charisma" |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
220 for ai=0 to 5:rem attribute index |
|||
⚫ | |||
230 for i=0 to 3:di(i)=int(rnd(.)*6)+1:next i |
|||
⚫ | |||
155 for i=1 to 4:di(i)=int(rnd(1)*6)+1:next i |
|||
250 dt=0:rem dice total |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
390 print "Do you accept? "; |
|||
⚫ | |||
235 print "Do you accept? "; |
|||
410 print k$ |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
2020 return |
|||
⚫ | |||
{{out}} |
{{out}} |