Escreva o código mais curto medido pela contagem de bytes para gerar uma grade ASCII composta por rhombi, considerando os seguintes parâmetros:
- m - número de rombos completos em uma linha
- n - número de linhas
- s - lado do menor losango
- r - nível de aninhamento - quantos losangos existem dentro dos "base" (que são fonud entre as interseções da grade)
Exemplos
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
Certifique-se de exibir o losango parcialmente visível nas bordas e nos cantos, quando necessário.