Using Python 3, please ensure that the test input and expected output works.

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Using Python 3, please ensure that the test input and expected output works.

Post by answerhappygod »

Using Python 3, please ensure that the test input and expected
output works.
Using Python 3 Please Ensure That The Test Input And Expected Output Works 1
Using Python 3 Please Ensure That The Test Input And Expected Output Works 1 (58.35 KiB) Viewed 10 times
Input: The first line of input contains one of the string values left right up or down to describes the direction of the move requested by the player. The next four lines describe a valid state of the 2048 puzzle. Every line has four integers from the set {0, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024} and represents a corresponding row of the 4 x 4 grid. A cell with a zero is considered to be empty. For example: right 0404 32 32 32 16 8 8 8 8 2004 Output: Four lines with four integers representing the puzzle's state after the player's move is completed. Integers in the line must be space-delimited. Empty cells in the grid are described with zeroes. In the real 2048 game, after each move, a new tile with a value of 2 or 4 will randomly appear in an empty cell. You can ignore this behavior in your solution and determine the state of the grid immediately before the new tile would appear. For example: 0 0 0 8 0 32 64 16 0 0 16 16 0024 Test 1 Test Input left 4004 32 16 16 32 512 1024 1024 256 2 4 8 16 Expected Output 8000 32 32 32 0 512 2048 256 0 2 4 8 16
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply