Solved How to make txt from a txt file appear side by side in batch

February 28, 2017 at 19:43:59
Specs: Windows 64
I have created a poker game in batch that displays the cards from .txt files. I use the following code to display them.

if %color% == orange type %card%of%suit%.txt & type %cardd%of%suitt%.txt
This works fine other than the cards are displayed one on top of the other like this:

.------.
|A /\ |
| / \ |
| \ / |
| \/ A|
^------^
.------.
|A /\ |
| / \ |
| \ / |
| \/ A|
^------^
I want the cards to be displayed side by side like this:

.------. .------.
|A /\ | |A /\ |
| / \ | | / \ |
| \ / | | \ / |
| \/ A| | \/ |
^------^ ^------^
Thanks in advance!

EDIT: the cards won't type in correctly for some reason but you get the gist

message edited by BatchBeginning


See More: How to make txt from a txt file appear side by side in batch

Report •

#1
March 1, 2017 at 19:16:18
✔ Best Answer
When you build the display, you need to append each line of each card to the same line of the previous card. So, your outer loop goes from top to bottom, in "raster" fashion, and your inner loop goes from card to card, building a single string for each line of all (5) cards. Same approach as is used in batch "movement" games.


Report •
Related Solutions


Ask Question