From e25ce1416d7a4461ba95a22578cc35b6223adbb5 Mon Sep 17 00:00:00 2001 From: John Tokhi <56596400+tokhij@users.noreply.github.com> Date: Sat, 26 Oct 2019 19:49:16 -0400 Subject: [PATCH] Done --- .idea/compiler.xml | 16 +++++++++++++++ .idea/misc.xml | 13 ++++++++++++ .idea/modules.xml | 8 ++++++++ .idea/vcs.xml | 6 ++++++ PlaylistChallenge.iml | 16 +++++++++++++++ pom.xml | 10 ++++++--- src/main/java/io/zipcoder/Music.java | 19 ++++++++++++++++-- target/classes/io/zipcoder/Music.class | Bin 0 -> 896 bytes .../test-classes/io/zipcoder/MusicTest.class | Bin 0 -> 1381 bytes 9 files changed, 83 insertions(+), 5 deletions(-) create mode 100644 .idea/compiler.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml create mode 100644 PlaylistChallenge.iml create mode 100644 target/classes/io/zipcoder/Music.class create mode 100644 target/test-classes/io/zipcoder/MusicTest.class diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 0000000..d529bcc --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..ff20635 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,13 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..5103107 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/PlaylistChallenge.iml b/PlaylistChallenge.iml new file mode 100644 index 0000000..ea9ab4f --- /dev/null +++ b/PlaylistChallenge.iml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/pom.xml b/pom.xml index bbd82c1..6402c2c 100644 --- a/pom.xml +++ b/pom.xml @@ -4,17 +4,21 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - io.zipcoder - PlaylistChallenge + com.zipcodewilmington + loop_labs 1.0-SNAPSHOT + + 1.8 + 1.8 + junit junit 4.12 - test + \ No newline at end of file diff --git a/src/main/java/io/zipcoder/Music.java b/src/main/java/io/zipcoder/Music.java index 180c65c..547df24 100644 --- a/src/main/java/io/zipcoder/Music.java +++ b/src/main/java/io/zipcoder/Music.java @@ -9,6 +9,21 @@ public Music(String[] playList){ } public Integer selection(Integer startIndex, String selection){ - return null; + int counterForward = 0; + int counterBackward = 0; + for (int i = 0; i <= startIndex; i++) { + counterForward++; + } + for (int j = 0; j < playList.length; j++) { + counterBackward++; + } + if(counterForward < counterBackward){ + return counterForward; + } + else{ + return counterBackward; + + } + } } -} + diff --git a/target/classes/io/zipcoder/Music.class b/target/classes/io/zipcoder/Music.class new file mode 100644 index 0000000000000000000000000000000000000000..06e143b159116324100a2b9080a5e839f4721914 GIT binary patch literal 896 zcmZuv%Wl(95Ixs+>cqHh9!+?LQeI6`sbPV-pjA;ps)&@*MNl`a9LIzkj2$^nd93>- zWx*CCUSiP?;7eG-7NNqqPG}-gS)My{X6BwVV}CpTdIaD$Y8GZt&LD-$78Y?unI#if zO~!`6LjmXIFdnkU0`NI1~T3hC{<3$SN8;r`(eium~YC! zdpLaF_M%5l+b5E5hOXo9IgwQH7&PLiazL`C4C}9D-(_!9-x&_1OR~(s^F23~VIXj) zG9{-G#9r5n)~BGc!s-B{pF&S2pL4?@X`}5h zdf`MJPB;ecIqtI>Vyj?>PPOa8@fEMy|Il)%aF2)vDsNk->EvCekKu*tm&h8x>Rq za{p~XAUjdG+wO540(wO)IyXs-rStpAAl`HQA^BLuiOqc#?LJW-tZ~|Mu*5%MhJS{D zrWDcB=x1Qjo?*1jSmSBcK10-2K0T8C+mMW%JK0$v2`#={5De?Bt&jhS}fOd39)EJ>Z%0=T4>GBsC?}~=9 zyhMkRvYLpsdGRak(NXs)@U{9HLA@L~eME(}* tOO&m!EY9+N4R_gJAa4pAI8VONktq$A{sQt*xS0R| literal 0 HcmV?d00001 diff --git a/target/test-classes/io/zipcoder/MusicTest.class b/target/test-classes/io/zipcoder/MusicTest.class new file mode 100644 index 0000000000000000000000000000000000000000..b23c7991d6b696f7ead1ef723baab9fc8739d78f GIT binary patch literal 1381 zcmcIjSx*yD6#j-zJ7X;s1_kO;6&G5zio3-PjYg6xi6u=MpKhnua&ef!SrGkKz6jCi zlTZFA<9DHpTIp>HPTl`5S=ic$CEuN*2mCrff{xn6WWyVJ-^`l`O7c zUPo86xQ6RCZrHeKGHo+puVS7a0~7|2J`lWwd6Unk}b*c+aB@2My@ zF!HLlCN@RI6Mm;sk3;2m*pXh>?RlWzy3ScEYvm;AQe(p5c(B|nxO8M5lgKC9N< ztJo*8<<3}lKZH3=pTjU5!u%C$z-Z}^{pr8ZaL;9TC1ltXULu!Y>$atG-%5H*tCkK)_ocea zJG^g@d06N}?`FykoX0VKPWqPu&A{PvgtrP$gJ*hb z8^%Wl131oSW;dC^3C6j-0*qpeHv{8r9@uUE4wIiC@W}d#fo94{)tjbc)|+W3U2kTb zOuhC6R&#nA_H%OwM_xFYs+nd`P0!30%umQxGlg^^vxB2O<_XwDJc{cm409Akq={v-wn(QJ zh^GBsMA3nu^ZQUGcxV JyG)Oq%rAlTDFy%l literal 0 HcmV?d00001