This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package Main | |
import java.io.{FileInputStream, FileOutputStream} | |
import scala.io.StdIn | |
object Main extends App { | |
Console.setIn(new FileInputStream("example.in")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object Main { | |
def AND(x1:Double, x2:Double): Double = { | |
val w1 = 0.5 | |
val w2 = 0.5 | |
val b = -0.7 | |
val tmp = x1 * w1 + x2 * w2 + b | |
if (tmp <= 0) { | |
0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
foldLString : (List String) -> String | |
foldLString [] = "" | |
foldLString (x :: xs) = x ++ "\n" ++ foldLString xs | |
readAndSave : IO () | |
readAndSave = do lines <- readToBlank | |
putStrLn "Enter file name:" | |
fileName <- getLine | |
writeFile fileName (foldLString lines) | |
pure () |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package Main | |
import java.io.{FileInputStream, FileOutputStream} | |
import scala.io.StdIn | |
object Main extends App { | |
Console.setIn(new FileInputStream("example.in")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package io.github.robhinds.nn | |
import io.github.robhinds.nn.builder.NNBuilder | |
import scala.io.Source | |
object Main { | |
def main(args: Array[String]): Unit = { | |
val data = Source.fromURL(getClass.getResource("/train.csv")) | |
val lines: Iterator[String] = data.getLines() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package Main | |
import java.io.{FileInputStream, FileOutputStream} | |
import scala.io.StdIn | |
object Main extends App { | |
Console.setIn(new FileInputStream("example.in")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package lascala.turtle | |
import lascala.turtle.common._ | |
object BasicOO { | |
class Turtle(log: String => Unit) { | |
var currentPosition: Position = initialPosition | |
var currentAngle: Angle = 0.0.degree | |
var currentColor: PenColor = initialColor | |
var currentPenState: PenState = initialPenState |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package lascala.turtle | |
import lascala.turtle.common.PenState.{Down, Up} | |
import lascala.turtle.common._ | |
object BasicFP { | |
case class TurtleState(position : Position, angle : Angle, color : PenColor, penState : PenState) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package Main | |
import java.io.{FileInputStream, FileOutputStream} | |
import scala.annotation.tailrec | |
import scala.io.StdIn | |
object Main extends App { | |
Console.setIn(new FileInputStream("example.in")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package Main | |
import java.io.{FileInputStream, FileOutputStream} | |
import scala.annotation.tailrec | |
import scala.io.StdIn | |
object Main extends App { | |
Console.setIn(new FileInputStream("example.in")) |