Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .gradle/4.10.3/fileChanges/last-build.bin
Binary file not shown.
Binary file added .gradle/4.10.3/fileHashes/fileHashes.bin
Binary file not shown.
Binary file added .gradle/4.10.3/fileHashes/fileHashes.lock
Binary file not shown.
Empty file added .gradle/4.10.3/gc.properties
Empty file.
Binary file added .gradle/4.10.3/taskHistory/taskHistory.bin
Binary file not shown.
Binary file added .gradle/4.10.3/taskHistory/taskHistory.lock
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added .gradle/6.7.1/fileChanges/last-build.bin
Binary file not shown.
Binary file added .gradle/6.7.1/fileHashes/fileHashes.bin
Binary file not shown.
Binary file added .gradle/6.7.1/fileHashes/fileHashes.lock
Binary file not shown.
Empty file added .gradle/6.7.1/gc.properties
Empty file.
Binary file added .gradle/6.7.1/javaCompile/classAnalysis.bin
Binary file not shown.
Binary file added .gradle/6.7.1/javaCompile/javaCompile.lock
Binary file not shown.
Binary file added .gradle/6.7.1/javaCompile/taskHistory.bin
Binary file not shown.
Binary file added .gradle/buildOutputCleanup/buildOutputCleanup.lock
Binary file not shown.
2 changes: 2 additions & 0 deletions .gradle/buildOutputCleanup/cache.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#Wed Nov 18 16:09:32 EAT 2020
gradle.version=6.7.1
Binary file added .gradle/buildOutputCleanup/outputFiles.bin
Binary file not shown.
Binary file added .gradle/checksums/checksums.lock
Binary file not shown.
Empty file.
Empty file added .gradle/vcs-1/gc.properties
Empty file.
3 changes: 3 additions & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

214 changes: 42 additions & 172 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added build/classes/java/main/App.class
Binary file not shown.
Binary file added build/classes/java/main/models/PingPong.class
Binary file not shown.
4 changes: 4 additions & 0 deletions build/tmp/compileJava/source-classes-mapping.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
models/PingPong.java
models.PingPong
App.java
App
Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
Binary file added out/production/classes/App.class
Binary file not shown.
Binary file added out/production/classes/models/PingPong.class
Binary file not shown.
Binary file added out/test/classes/AppTest.class
Binary file not shown.
Binary file added out/test/classes/models/PingPongTest.class
Binary file not shown.
25 changes: 23 additions & 2 deletions src/main/java/App.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
public class App {
import models.PingPong;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;

}
public class App {
public static void main(String[] args) {
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in));
System.out.println("I'm a ping-pong application!");
System.out.println("Enter a number:");
try {
String stringUserNumber = bufferedReader.readLine();
int intUserNumber = Integer.parseInt(stringUserNumber);
PingPong pingPong = new PingPong();
ArrayList<Object> pingPongResult = pingPong.runPingPong(intUserNumber);
System.out.println(pingPongResult);
}
catch (IOException e){
e.printStackTrace();
}
}
}
15 changes: 14 additions & 1 deletion src/main/java/models/PingPong.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,25 @@
package models;


import java.util.ArrayList;
import java.util.List;

public class PingPong {

public ArrayList<Object> runPingPong(int countUpTo){
ArrayList<Object> result = new ArrayList<Object>();
return null;
for (int i = 1; i <= countUpTo; i++){
if (i % 3 == 0 && i % 5 == 0){
result.add("pingpong");
} else if (i % 3 == 0){
result.add("ping");
} else if (i % 5 == 0){
result.add("pong");
} else {
result.add(i);
}
}
return result;
}

}
5 changes: 5 additions & 0 deletions src/test/java/AppTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import static org.junit.Assert.*;

public class AppTest {

}
Loading