September 2017 Update
This commit is contained in:
parent
bba7bfd280
commit
ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions
9
Task/Narcissist/Kotlin/narcissist.kotlin
Normal file
9
Task/Narcissist/Kotlin/narcissist.kotlin
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
// version 1.1.0 (run on Windows 10)
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
val text = java.io.File("narcissist.kt").readText()
|
||||
println("Enter the number of lines to be input followed by those lines:\n")
|
||||
val n = readLine()!!.toInt()
|
||||
val lines = Array<String>(n) { readLine()!! }
|
||||
if (lines.joinToString("\r\n") == text) println("\naccept") else println("\nreject")
|
||||
}
|
||||
13
Task/Narcissist/Swift/narcissist.swift
Normal file
13
Task/Narcissist/Swift/narcissist.swift
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
#! /usr/bin/swift
|
||||
import Foundation
|
||||
|
||||
let script = CommandLine.arguments[0]
|
||||
print(script)
|
||||
let mytext = try? String.init(contentsOfFile: script, encoding: .utf8)
|
||||
|
||||
var enteredtext = readLine()
|
||||
if mytext == enteredtext {
|
||||
print("Accept")
|
||||
} else {
|
||||
print("Reject")
|
||||
}
|
||||
3
Task/Narcissist/Zkl/narcissist.zkl
Normal file
3
Task/Narcissist/Zkl/narcissist.zkl
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
stdin:=File.stdin.read();
|
||||
thisFileSrc:=File(System.argv[1]).read();
|
||||
println((stdin==thisFileSrc) and "input matches "+System.argv[1] or "No match");
|
||||
Loading…
Add table
Add a link
Reference in a new issue