다음과 같은 매개 변수를 사용하여 바이트 수로 측정 된 가장 짧은 코드를 작성하여 마름모꼴로 구성된 ASCII 그리드를 생성하십시오.
- m-한 행에 완전한 마름모꼴 수
- n-행 수
- s-가장 작은 마름모의 측면
- r-중첩 수준- "기본 것들"내부에 몇 개의 마름모꼴이 있는지 (그리드의 교차점 사이에서 퐁당 함)
예
1. Input: 5 3 1 0
Output:
/\/\/\/\/\
\/\/\/\/\/
/\/\/\/\/\
\/\/\/\/\/
/\/\/\/\/\
\/\/\/\/\/
A 5x3 grid of rhombi with side 1, no nesting
2. Input: 3 2 2 0
Output:
/\ /\ /\
/ \/ \/ \
\ /\ /\ /
\/ \/ \/
/\ /\ /\
/ \/ \/ \
\ /\ /\ /
\/ \/ \/
A 3x2 grid of rhombi with side 2, no nesting
3. Input: 5 2 1 2
Output:
///\\\///\\\///\\\///\\\///\\\
///\\\///\\\///\\\///\\\///\\\
///\\\///\\\///\\\///\\\///\\\
\\\///\\\///\\\///\\\///\\\///
\\\///\\\///\\\///\\\///\\\///
\\\///\\\///\\\///\\\///\\\///
///\\\///\\\///\\\///\\\///\\\
///\\\///\\\///\\\///\\\///\\\
///\\\///\\\///\\\///\\\///\\\
\\\///\\\///\\\///\\\///\\\///
\\\///\\\///\\\///\\\///\\\///
\\\///\\\///\\\///\\\///\\\///
A 5x2 grid of rhombi with side 1 (the smallest rhombus), level of nesting is 2
4. Input: 4 2 2 1
Output:
//\\ //\\ //\\ //\\
///\\\///\\\///\\\///\\\
// \\// \\// \\// \\
\\ //\\ //\\ //\\ //
\\\///\\\///\\\///\\\///
\\// \\// \\// \\//
//\\ //\\ //\\ //\\
///\\\///\\\///\\\///\\\
// \\// \\// \\// \\
\\ //\\ //\\ //\\ //
\\\///\\\///\\\///\\\///
\\// \\// \\// \\//
A 4x2 grid of rhombi with side 2 with level of nesting 1
5. Input: 4 2 3 3
Output:
////\\\\ ////\\\\ ////\\\\ ////\\\\
/////\\\\\ /////\\\\\ /////\\\\\ /////\\\\\
//////\\\\\\//////\\\\\\//////\\\\\\//////\\\\\\
//////\\\\\\//////\\\\\\//////\\\\\\//////\\\\\\
///// \\\\\///// \\\\\///// \\\\\///// \\\\\
//// \\\\//// \\\\//// \\\\//// \\\\
\\\\ ////\\\\ ////\\\\ ////\\\\ ////
\\\\\ /////\\\\\ /////\\\\\ /////\\\\\ /////
\\\\\\//////\\\\\\//////\\\\\\//////\\\\\\//////
\\\\\\//////\\\\\\//////\\\\\\//////\\\\\\//////
\\\\\///// \\\\\///// \\\\\///// \\\\\/////
\\\\//// \\\\//// \\\\//// \\\\////
////\\\\ ////\\\\ ////\\\\ ////\\\\
/////\\\\\ /////\\\\\ /////\\\\\ /////\\\\\
//////\\\\\\//////\\\\\\//////\\\\\\//////\\\\\\
//////\\\\\\//////\\\\\\//////\\\\\\//////\\\\\\
///// \\\\\///// \\\\\///// \\\\\///// \\\\\
//// \\\\//// \\\\//// \\\\//// \\\\
\\\\ ////\\\\ ////\\\\ ////\\\\ ////
\\\\\ /////\\\\\ /////\\\\\ /////\\\\\ /////
\\\\\\//////\\\\\\//////\\\\\\//////\\\\\\//////
\\\\\\//////\\\\\\//////\\\\\\//////\\\\\\//////
\\\\\///// \\\\\///// \\\\\///// \\\\\/////
\\\\//// \\\\//// \\\\//// \\\\////
A 4x2 grid of rhombi with side 3, level of nesting 3
필요한 경우 가장자리와 모서리에 부분적으로 보이는 마름모꼴을 표시하십시오.