### Bookstore

 Computer Math and Games in Pascal (preview) Lazarus Handbook

### Author Topic: Single deminision arrays(Solved)  (Read 972 times)

#### MarkMLl

• Hero Member
• Posts: 4507
##### Re: Single deminision arrays(Solved)
« Reply #15 on: June 21, 2022, 11:27:06 am »
No, I never considered sets. I have a array of records.
That would be ill informed for a card game (for lack of an abusive term) because for a card game you can use include/exclude, so the set will represent the cards that are still in the deck or already played. If you write a card game, sets are the way to go.
E.g. Poker can be written in less than 100 lines using sets. Bridge a bit more, but that is just handling logic, so does not count to your problem.
An array of records can be handled with e.g. the sets in rtl-generics.

Might get more complicated than a simple set if more than one deck is involved... or a game has more than one indistinguishable joker.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

• Hero Member
• Posts: 11637
##### Re: Single deminision arrays(Solved)
« Reply #16 on: June 21, 2022, 11:38:34 am »
Might get more complicated than a simple set if more than one deck is involved... or a game has more than one indistinguishable joker.

MarkMLl
Actually not. The logic is the same. Only provision is to identify the deck in the record.
Black themes should be banned.

#### JLWest

• Hero Member
• Posts: 1092
##### Re: Single deminision arrays(Solved)
« Reply #17 on: July 05, 2022, 10:18:15 pm »

No disrespect Thaddy but I don't think a bridge game came be written in less than 200 lines.

I'm at about 3,000 and and probably a 1,000 more line to finish.
FPC 3.2.0, Lazarus IDE v2.0.4
Windows 10 Pro 32-GB
Intel i7 770K CPU 4.2GHz 32702MB Ram
GeForce GTX 1080 Graphics - 8 Gig
4.1 TB

#### MarkMLl

• Hero Member
• Posts: 4507
##### Re: Single deminision arrays(Solved)
« Reply #18 on: July 05, 2022, 10:22:46 pm »
No disrespect Thaddy but I don't think a bridge game came be written in less than 200 lines.