parent
83f0e9a869
commit
eb7a09fc19
@ -0,0 +1,7 @@ |
|||||||
|
name := "Weeapass" |
||||||
|
|
||||||
|
version := "1.0" |
||||||
|
|
||||||
|
scalaVersion := "2.10.1" |
||||||
|
|
||||||
|
libraryDependencies += "com.beust" % "jcommander" % "1.30" |
@ -0,0 +1 @@ |
|||||||
|
addSbtPlugin("com.github.mpeltonen" % "sbt-idea" % "1.4.0") |
@ -1,9 +0,0 @@ |
|||||||
/** |
|
||||||
* Created with IntelliJ IDEA. |
|
||||||
* User: jcd |
|
||||||
* Date: 4/25/13 |
|
||||||
* Time: 9:46 PM |
|
||||||
*/ |
|
||||||
object Launcher extends App{ |
|
||||||
|
|
||||||
} |
|
@ -0,0 +1,38 @@ |
|||||||
|
package org.hjiri.weapass |
||||||
|
import com.beust.jcommander.{JCommander, Parameter} |
||||||
|
|
||||||
|
|
||||||
|
/** |
||||||
|
* Created with IntelliJ IDEA. |
||||||
|
* User: jcd |
||||||
|
* Date: 4/25/13 |
||||||
|
* Time: 9:46 PM |
||||||
|
*/ |
||||||
|
object Launcher extends App{ |
||||||
|
object Args { |
||||||
|
// Declared as var because JCommander assigns a new collection declared |
||||||
|
// as java.util.List because that's what JCommander will replace it with. |
||||||
|
// It'd be nice if JCommander would just use the provided List so this |
||||||
|
// could be a val and a Scala LinkedList. |
||||||
|
@Parameter( |
||||||
|
names = Array("-l"), |
||||||
|
description = "When genelatingu wolds use L instead of R") |
||||||
|
var lefto: Boolean = false |
||||||
|
|
||||||
|
@Parameter( |
||||||
|
names = Array("-s"), |
||||||
|
description = "When generating wordsh ushe S instead of SH") |
||||||
|
var shisi: Boolean = false |
||||||
|
} |
||||||
|
|
||||||
|
if (args != null){ |
||||||
|
new JCommander(Args, args.toArray : _*) |
||||||
|
} |
||||||
|
val s:SyllableGenerator = new SyllableGenerator(!Args.shisi, !Args.lefto) |
||||||
|
val w:WordGenerator = new WordGenerator(s) |
||||||
|
for (i <- 1 to Randomizer.pickInt(2,5)){ |
||||||
|
System.out.print (w.generateWord.toString+" ") |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
} |
@ -1,3 +1,5 @@ |
|||||||
|
package org.hjiri.weapass |
||||||
|
|
||||||
import scala.util.Random |
import scala.util.Random |
||||||
|
|
||||||
/** |
/** |
@ -1,3 +1,5 @@ |
|||||||
|
package org.hjiri.weapass |
||||||
|
|
||||||
/** |
/** |
||||||
* Created with IntelliJ IDEA. |
* Created with IntelliJ IDEA. |
||||||
* User: jcd |
* User: jcd |
@ -1,3 +1,5 @@ |
|||||||
|
package org.hjiri.weapass |
||||||
|
|
||||||
/** |
/** |
||||||
* Created with IntelliJ IDEA. |
* Created with IntelliJ IDEA. |
||||||
* User: jcd |
* User: jcd |
@ -1,3 +1,5 @@ |
|||||||
|
package org.hjiri.weapass |
||||||
|
|
||||||
/** |
/** |
||||||
* Created with IntelliJ IDEA. |
* Created with IntelliJ IDEA. |
||||||
* User: jcd |
* User: jcd |
@ -1,48 +0,0 @@ |
|||||||
/** |
|
||||||
* Created with IntelliJ IDEA. |
|
||||||
* User: jcd |
|
||||||
* Date: 4/25/13 |
|
||||||
* Time: 10:43 PM |
|
||||||
* |
|
||||||
* sample workspace file to view how generator behaves. |
|
||||||
*/ |
|
||||||
val s:SyllableGenerator = new SyllableGenerator(false, false, true) |
|
||||||
val w:WordGenerator = new WordGenerator(s) |
|
||||||
for (i <- 1 to 28){ |
|
||||||
System.out.println (w.generateWord.toString+" ") |
|
||||||
} |
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in new issue