Welcome to the Builder Academy

Question Can the column_list output order be horizontal?

More
29 Aug 2020 21:51 #9205 by thomas
I understand your reason, I I just had a real facepalm moment. I was changing the wrong code. This is correct:
Code:
@@ -990,9 +990,9 @@ void column_list(struct char_data *ch, int num_cols, const char **list, int list num_per_col = (list_length / num_cols) + ((list_length % num_cols) ? 1 : 0); /* Fill 'buf' with the columnised list */ - for (r=0; r<num_per_col; r++) + for (c=0; c<num_cols; c++) { - for (c=0; c<num_cols; c++) + for (r=0; r<num_per_col; r++) { offset = (c*num_per_col)+r; if (offset < list_length)

In short, revert the change above and then just switch the loops.

Please Log in or Create an account to join the conversation.

More
30 Aug 2020 01:15 - 30 Aug 2020 01:19 #9213 by cry1004
Thanks for your kind response.

I modified it the way you taught me.

I printed out a list of socials for testing.

All socials list is divided into pages and printed normally.

However, it seems that each row cannot be separated into 80 columns. :)

Attachment 193.jpg not found



Again, I look forward to your advice.
Last edit: 30 Aug 2020 01:19 by cry1004.

Please Log in or Create an account to join the conversation.

More
30 Aug 2020 21:59 - 30 Aug 2020 22:00 #9260 by thomas
Ack. I was wrong again. And almost right the first time:
Code:
@@ -994,7 +994,7 @@ void column_list(struct char_data *ch, int num_cols, const char **list, int list { for (c=0; c<num_cols; c++) { - offset = (c*num_per_col)+r; + offset = (r*num_cols)+c; if (offset < list_length) { if (show_nums)

It turns out I made the lines way too long to fit the page, so they wrapped really weirdly. And even more so with your language.
Last edit: 30 Aug 2020 22:00 by thomas.
The following user(s) said Thank You: cry1004

Please Log in or Create an account to join the conversation.

More
31 Aug 2020 01:20 #9269 by cry1004
Thanks for your kind and quick reply.

Attachment 194.jpg not found



It works very well.

Please Log in or Create an account to join the conversation.

Time to create page: 0.202 seconds