การใช้ ASCII พิมพ์ส่วนของการเรียงแหวนวงแหวนหกเหลี่ยม
นี่คือส่วนเล็ก ๆ :
/\__/\
/_/ \_\
/\__/\ \__/ /\__/\
/_/ \_\/__\/_/ \_\
\ \__/ /\__/\ \__/ /
\/__\/_/ \_\/__\/
/\__/\ \__/ /\__/\
/_/ \_\/__\/_/ \_\
\ \__/ /\__/\ \__/ /
\/__\/_/ \_\/__\/
\ \__/ /
\/__\/
นี่คือส่วนที่ใหญ่กว่า:
\ \__/ /\__/\ \__/ /\__/\ \__/ /\__/\ \__/ /\__/\
\/__\/_/ \_\/__\/_/ \_\/__\/_/ \_\/__\/_/ \_\
/\__/\ \__/ /\__/\ \__/ /\__/\ \__/ /\__/\ \__/ /
/_/ \_\/__\/_/ \_\/__\/_/ \_\/__\/_/ \_\/__\/
\ \__/ /\__/\ \__/ /\__/\ \__/ /\__/\ \__/ /\__/\
\/__\/_/ \_\/__\/_/ \_\/__\/_/ \_\/__\/_/ \_\
/\__/\ \__/ /\__/\ \__/ /\__/\ \__/ /\__/\ \__/ /
/_/ \_\/__\/_/ \_\/__\/_/ \_\/__\/_/ \_\/__\/
\ \__/ /\__/\ \__/ /\__/\ \__/ /\__/\ \__/ /\__/\
\/__\/_/ \_\/__\/_/ \_\/__\/_/ \_\/__\/_/ \_\
/\__/\ \__/ /\__/\ \__/ /\__/\ \__/ /\__/\ \__/ /
/_/ \_\/__\/_/ \_\/__\/_/ \_\/__\/_/ \_\/__\/
ท้าทาย
รับ 2 จำนวนเต็มh
และw
โดยที่h
ความสูงและw
เป็นความกว้างเอาท์พุทhxw
ส่วนของการเรียงแหวนแหวนหกเหลี่ยม
ตัวอย่าง
อินพุต 1
4x4
เอาท์พุท 1
/\__/\ \__/ /\__/\ \__/ /
/_/ \_\/__\/_/ \_\/__\/
\ \__/ /\__/\ \__/ /\__/\
\/__\/_/ \_\/__\/_/ \_\
/\__/\ \__/ /\__/\ \__/ /
/_/ \_\/__\/_/ \_\/__\/
\ \__/ /\__/\ \__/ /\__/\
\/__\/_/ \_\/__\/_/ \_\
/\__/\ \__/ /\__/\ \__/ /
/_/ \_\/__\/_/ \_\/__\/
\ \__/ /\__/\ \__/ /\__/\
\/__\/_/ \_\/__\/_/ \_\
/\__/\ \__/ /\__/\ \__/ /
/_/ \_\/__\/_/ \_\/__\/
\ \__/ /\__/\ \__/ /\__/\
\/__\/_/ \_\/__\/_/ \_\
อินพุต 2
3x3
เอาท์พุท 2
/\__/\ \__/ /\__/\
/_/ \_\/__\/_/ \_\
\ \__/ /\__/\ \__/ /
\/__\/_/ \_\/__\/
/\__/\ \__/ /\__/\
/_/ \_\/__\/_/ \_\
\ \__/ /\__/\ \__/ /
\/__\/_/ \_\/__\/
/\__/\ \__/ /\__/\
/_/ \_\/__\/_/ \_\
\ \__/ /\__/\ \__/ /
\/__\/_/ \_\/__\/
อินพุต 3
1x3
เอาท์พุท 3
/\__/\ \__/ /\__/\
/_/ \_\/__\/_/ \_\
\ \__/ /\__/\ \__/ /
\/__\/_/ \_\/__\/
อินพุต 4
3x6
เอาท์พุท 4
/\__/\ \__/ /\__/\ \__/ /\__/\ \__/ /
/_/ \_\/__\/_/ \_\/__\/_/ \_\/__\/
\ \__/ /\__/\ \__/ /\__/\ \__/ /\__/\
\/__\/_/ \_\/__\/_/ \_\/__\/_/ \_\
/\__/\ \__/ /\__/\ \__/ /\__/\ \__/ /
/_/ \_\/__\/_/ \_\/__\/_/ \_\/__\/
\ \__/ /\__/\ \__/ /\__/\ \__/ /\__/\
\/__\/_/ \_\/__\/_/ \_\/__\/_/ \_\
/\__/\ \__/ /\__/\ \__/ /\__/\ \__/ /
/_/ \_\/__\/_/ \_\/__\/_/ \_\/__\/
\ \__/ /\__/\ \__/ /\__/\ \__/ /\__/\
\/__\/_/ \_\/__\/_/ \_\/__\/_/ \_\