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 main(args: Array[String]){ | |
val sc = new java.util.Scanner(System.in) | |
val num = sc.nextInt | |
val board = List.fill(num)(sc.nextInt) | |
val count = 0 | |
println(operate(board, count)) | |
} | |
def operate(board: List[Int], count: Int):Int = { | |
if(board.forall(_ % 2 == 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
return diffval.`val`(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
[error] /home/satoru/work/scala_test/animecut/src/main/scala/animecut.scala:44:20: identifier expected but 'val' found. | |
[error] return diffval.val(0) | |
[error] ^ |
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
val diffval:Scalar = Core.mean(diff) | |
return diffval.val(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
const actions = { | |
update: (e) => state => { | |
state = {...state, oneProperty: e.target.value} | |
return {...state, anotherProperty: state.oneProperty.length} | |
} | |
} |
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
const actions = { | |
update: (e) => state => { | |
updateInput(e) | |
return reCalculate() | |
}, | |
updateInput: (e) => state => ({...state, oneProperty: e.target.value}), | |
reCalculate: () => state => ({...state, anotherProperty: state.oneProperty.length}) | |
} |
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
const actions = { | |
update: (e) => state => { | |
updateInput(e, state) | |
return reCalculate(state) | |
}, | |
updateInput: (e, state) => ({...state, oneProperty: e.target.value}), | |
reCalculate: state => ({...state, anotherProperty: state.oneProperty.length}) | |
} |
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
class Chao: | |
r = "resources" | |
imgs = [os.path.join(r, "img{0:02}.jpg".format(x)) for x in range(10)] |
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
NameError: name 'r' is not defined |
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
othersMovement.append(list(map(int, map(float, row)))) # that's why I hate Python. |
OlderNewer