From 2f7636f02334bd02471d059ef774b8601d5732cb Mon Sep 17 00:00:00 2001 From: ginaesps Date: Sat, 24 Dec 2022 12:00:37 -0600 Subject: [PATCH] punched cards python solution uploaded - Apprentice 2022d --- solutions/punched_cards/.DS_Store | Bin 0 -> 6148 bytes solutions/punched_cards/punched_cardss.js | 77 ++++++++++++++++++++++ 2 files changed, 77 insertions(+) create mode 100644 solutions/punched_cards/.DS_Store create mode 100644 solutions/punched_cards/punched_cardss.js diff --git a/solutions/punched_cards/.DS_Store b/solutions/punched_cards/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..d5ac2e94e8a2e9c835f9958f65087f308209a23b GIT binary patch literal 6148 zcmeHK%SuB*3_Z~<3U02hT)3DoDEJ50+9GcC1Jpi1q*$?ZfB(o&)RTu|uY>MHB!S6E zXOc|jKxb|M$auRr1sVWD4nqF9c5EU~~1=D4dQ`ioOqdxIxz@yMz_ z*Z<6uY%szDHkYgQe70K8%ojK#j$TddNQd9VS2M^-FT+tU!#Vl${jV^^MYW2TUJffI zRWgtaBm>DnGVmhV_+UWqhr*%Q26m2ibx>IgKpb$|gtqn)8dCz> zz|N5?6!B1^hf1^<;^CYx;nxOsjvfw)=0jrV_vS@xcjhnV4rv`zCj-gAE(6;8QW|~# zr~J!Qn|yOgl?)^U|CIq5Os*$mo-W?jFXz;^ws72XsHk7328H&{M*x55J#uV|zFyR( YUmMstY8IWhaAJN47$K>WfnQ+Y4R~ig@Bjb+ literal 0 HcmV?d00001 diff --git a/solutions/punched_cards/punched_cardss.js b/solutions/punched_cards/punched_cardss.js new file mode 100644 index 00000000..f339c6f8 --- /dev/null +++ b/solutions/punched_cards/punched_cardss.js @@ -0,0 +1,77 @@ +'use strict'; + +process.stdin.resume(); +process.stdin.setEncoding('utf-8'); + +let inputString = ''; +let currentLine = 0; + +process.stdin.on('data', inputStdin => { + inputString += inputStdin; +}); + +process.stdin.on('end', _ => { + inputString = inputString.trim().split('\n').map(string => { + return string.trim(); + }); + + main(); +}); + +function readline() { + return inputString[currentLine++]; +} + +// Make a Snippet for the code above this and then write your logic in main(); + +const draw = (row, col) => { + let rowN = ''; + for (let r=0; r parseInt(x)); + row = (row*2) +1; + col = (col*2) +1; + + // Compute the value of the sum modulo M. + let drawing = draw(row, col); + + // Print the result onto the standard output. + process.stdout.write(drawing); +} + +function main() { + // Declare and read the number of test cases. + var T; + T = parseInt(readline()); + + // Loop over the number of test cases. + for (var test_no = 1; test_no <= T; test_no++) { + process.stdout.write('Case #' + test_no + ': \n'); + solve(); + } +} +