Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support outputting high-dimensional lists #147

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

weilycoder
Copy link
Contributor

增加输出高维列表:

from cyaron import IO

table = [['#', 'S', '.', '.', '#'], ['#', '#', '#', '.', '#'],
         ['#', '.', '#', '.', '#'], ['#', 'T', '#', '.', '#'],
         ['#', '.', '.', '.', '#']]

f = IO('test.in', disable_output=True)
f.input_write_list(table, separator=['', '\n', ''])

运行后 test.in 文件中:

#S..#
###.#
#.#.#
#T#.#
#...#

或者,将 separator 改为 ['', '\n', ' ']

# S . . #
# # # . #
# . # . #
# T # . #
# . . . #

@weilycoder weilycoder mentioned this pull request Nov 20, 2024
@weilycoder
Copy link
Contributor Author

另外,separator 可以改为一个字符串,如将示例中的 separator 改为 ' '

# S . . # # # # . # # . # . # # T # . # # . . . #

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant