this is a java based programming language we should use arra

this is a java based programming language. we should use arrays and loops for this exercise. program should create a 2D array of asterisks then one by one it should delete teh asterisk using the thread.sleep(1000) as the timer of how the asterisks are deleted one by one. the link thats provided at the end of the question shows how our program should act. finished product should just have the outside boundary left with everything else inside deleted

Program 2 (Loop statement, Array): Make a simple pac-man game that a sweeper removes all trashes in a room. The game runs on console but not GUI. You can use * and @ to express the trash and sweeper in the console. Once the game starts, the sweeper randomly moves until all trashes are removed. You can assume the room is fully filled with the trashes. Please make the room size flexible. Hint: Use array and while loop with Thread.sleep(1000)

here is an example from youtube that will help show what the program should look like

Example link: https://www.youtube.com/watch?v=RZ206gReXcc

Solution

/** * @fileName :EmptyArray.java * @author ravi * @since 18-02-2017 **/ package deletearray; import java.io.IOException; import java.lang.reflect.Array; import java.util.Arrays; import java.util.Random; import java.util.concurrent.ThreadLocalRandom; /** * Created by ravi on 18-02-2017. */ public class EmptyArray { public static void main(String[] args) throws InterruptedException, IOException { int N=4; char[][] array = new char[N][N]; for (char[] row : array) { for (int i = 0; i
this is a java based programming language. we should use arrays and loops for this exercise. program should create a 2D array of asterisks then one by one it sh

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site