Welcome to the Builder Academy

Question Can the column_list output order be horizontal?

More
27 Aug 2020 17:03 - 27 Aug 2020 17:05 #9070 by cry1004
Thanks for reading the question.

The current text string is sorted and displayed as follows.

A F K P U
B G L Q V
C H N R W
D I M S
E J O T

I am curious if there is a way to print it by arranging it horizontally as below.

A B C D E
F G H I J
K L N M O
P Q R S T
U V W


I used Google Translator because I was not good at English.
Last edit: 27 Aug 2020 17:05 by cry1004.

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

More
27 Aug 2020 19:35 #9078 by thomas
Quite easily. In the line github.com/tbamud/tbamud/blob/dceb563a9b...6f5/src/utils.c#L997 we're currently computing the next item by
Code:
offset = (c*num_per_col)+r;

To change to horizontal layout, switch it up a little:
Code:
offset = (r*num_per_col)+c;
The following user(s) said Thank You: cry1004

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

More
28 Aug 2020 04:16 - 28 Aug 2020 10:21 #9106 by cry1004
Thank you for your quick answer.

The direction of the list is printed as I want.

However, the list is printed too little on one screen.


Currently, it shows up to 23 lines of words on the screen, but only 7 lines of the current words.

I need to study GET_PAGE_LENGTH(ch).
Last edit: 28 Aug 2020 10:21 by cry1004.

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

More
28 Aug 2020 13:40 #9126 by cry1004
Changing the output horizontal layout is not as easy as I thought.

If I modify the source to
offset = (r*num_per_col)+c;
The list is printed horizontally,
but all lists are not output, or blank pages are output.

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

More
28 Aug 2020 21:06 #9138 by thomas
Do you have an example of output before and after?
The following user(s) said Thank You: cry1004

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

More
28 Aug 2020 23:04 - 28 Aug 2020 23:29 #9143 by cry1004
My country is used to reading horizontally.
So, when I sort and show the list, I want to show it horizontally first, and then show it down.
The current alignment method is to align it to the bottom left and to the right.
Code:
Aadi Babette Banks Cadee Caia Aafje Baby Banner Cadelaria Calanthe Aaid Bach Yen Bannister Caden Calbhach Aalam Bachelor Bansi Cadence Calder Aali Bachu Banu Cadenza Calderon Aalilyanna Ballari Banyan Cadewyn Caldwell Aaliyah Baltenis Bao Cadhla Cale Aamina Balthazar Baptiste Cadilyn Caleb Abeni Balwina Baqer Cadmus Caledon Abercromb Bambi Baqia Cady Caley Abha Bambina Cabernet Cael Calgary Abhay Ban Cable Caelan Calhoun Abhilash Banagher Cabrera Caerwyn Cali [ Return to continue, (q)uit, (r)efresh, (b)ack, or page number (1/4) ] Abhilasha Bancroft Cabriole Caesar Caliana Abhinav Bandana Cache Caesarea Calico Abia Bandele Cachet Cagatay Abiba Bandit Cactus Cage Abibola Bane Cad Cagney Baba Banji Cadak Cahya Baback Banjo Cade Cai

I am sorting from left to right like the following example,
I want to show it sorted down.
Code:
Aadi Aafje Aaid Aalam Aali Aalilyanna Aaliyah Aamina Abeni Abercrombie Abha Abhay Abhilash Abhilasha Abhinav Abia Abiba Abibola Baba Baback Babette Baby Bach Yen Bachelor Bachu Ballari Baltenis Balthazar Balwina Bambi Bambina Ban Banagher Bancroft Bandana Bandele Bandit Bane Banji Banjo Banks Banner Bannister Bansi Banu Banyan Bao Baptiste Baqer Baqia Cabernet Cable Cabrera Cabriole Cache Cachet Cactus Cad Cadak Cade Cadee Cadelaria Caden Cadence Cadenza [ Return to continue, (q)uit, (r)efresh, (b)ack, or page number (1/4) ] Cadewyn Cadhla Cadilyn Cadmus Cady Cael Caelan Caerwyn Caesar Caesarea Cagatay Cage Cagney Cahya Cai Caia Calanthe Calbhach Calder Calderon Caldwell Cale Caleb Caledon Caley Calgary Calhoun Cali Caliana Calico

If modified to
Code:
offset = (r*num_per_col)+c;

The output shape is what I want, but it doesn't show all the list, just a few lines.
And, the rest is shown as a blank page.
Code:
Aadi Aafje Aaid Aalam Aali Aalilyanna Aaliyah Aamina Abeni Abercrombie Abha Abhay Abhilash Abhilasha Abhinav Abia Abiba Abibola Baba Baback Babette Baby Bach Yen Bachelor Bachu Ballari Baltenis Balthazar Balwina Bambi [ Return to continue, (q)uit, (r)efresh, (b)ack, or page number (1/4) ] [ Return to continue, (q)uit, (r)efresh, (b)ack, or page number (2/4) ] [ Return to continue, (q)uit, (r)efresh, (b)ack, or page number (3/4) ]


The reason for this alignment is that our country is used to reading horizontally first. The current sorting method is to keep hitting enter to see all the missing names.

However, people in our country who are accustomed to reading horizontally can easily find the missing word without having to keep hitting the Enter key to go through the list by showing the list horizontally first and then showing the remaining list down.
Last edit: 28 Aug 2020 23:29 by cry1004.

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

Time to create page: 0.195 seconds