step1
パラメータを受け取るコントローラを作る
object Application extends Controller {
def parameterExample(parameter: String) = Action {
Ok(views.html.index(parameter))
}
}
| #!/usr/bin/python | |
| # -*- coding: utf-8 -*- | |
| import sys | |
| import urllib2 | |
| import json | |
| import os | |
| import tempfile | |
| import codecs | |
| from optparse import OptionParser |
| import scala.util.Random | |
| val r = new Random() | |
| r.shuffle(List("カ", "ド" ,"カ" ,"ワ", "ン", "ゴ")).take(4).mkString |
| import math._ | |
| import scala.util._ | |
| /** | |
| * Auto-generated code below aims at helping you parse | |
| * the standard input according to the problem statement. | |
| **/ | |
| object Player { | |
| def main(args: Array[String]) { |
| import math._ | |
| import scala.util._ | |
| /** | |
| * The code below will read all the game information for you. | |
| * On each game turn, information will be available on the standard input, you will be sent: | |
| * -> the total number of visible enemies | |
| * -> for each enemy, its name and distance from you | |
| * The system will wait for you to write an enemy name on the standard output. | |
| * Once you have designated a target: |
| Dim い As Integer | |
| For い = 0 To 5 | |
| 'ループ内の処理 | |
| Next い | |
| Dim ろ As Integer | |
| For ろ = 0 To 5 | |
| 'ループ内の処理 |
| def qSort[T <% Ordered[T]](data: List[T]): List[T] = { | |
| data match { | |
| case Nil => data | |
| case x::xs => { | |
| qSort(xs.filter(_ < x)) ++ List(x) ++ qSort(xs.filter(x <= _)) | |
| } | |
| } | |
| } | |
| qSort(List(2, 44, 5, 3, 1, 3, 9, 56, 7, 8, 4, 111, 0, 3, 4)) foreach println |
| def bubbleSort(arr: Array[Int]): Array[Int] = { | |
| for(i <- 0 until arr.length - 1; j <- 0 until arr.length - 1 - i) { | |
| if (arr(j) > arr (j + 1)) { | |
| val temp = arr(j) | |
| arr(j) = arr(j + 1) | |
| arr(j + 1) = temp | |
| } | |
| } | |
| arr | |
| } |
| class MyException(message: String, cause: Throwable) extends RuntimeException(message, cause) { | |
| def this() = this(null, null) | |
| def this(message: String) = this(message, null) | |
| def this(cause: Throwable) = this(null, cause) | |
| } |
| # -*- mode: ruby -*- | |
| # vi: set ft=ruby : | |
| Vagrant::Config.run do |config| | |
| # All Vagrant configuration is done here. The most common configuration | |
| # options are documented and commented below. For a complete reference, | |
| # please see the online documentation at vagrantup.com. | |
| # Every Vagrant virtual environment requires a box to build off of. | |
| config.vm.box = "centos64_64" |
step1
パラメータを受け取るコントローラを作る
object Application extends Controller {
def parameterExample(parameter: String) = Action {
Ok(views.html.index(parameter))
}
}