Skip to content

Instantly share code, notes, and snippets.

@yajamon
Created January 17, 2020 09:48
Show Gist options
  • Save yajamon/8e46b072ae7c25c8bf32cb48aa5a9317 to your computer and use it in GitHub Desktop.
Save yajamon/8e46b072ae7c25c8bf32cb48aa5a9317 to your computer and use it in GitHub Desktop.
paiza 解答セットアップ swift
#!/bin/bash
readonly DOC_ROOT=$(cd $(dirname ${BASH_SOURCE:-$0})/.. ; pwd)
if [ -z $1 ]; then
exit 1;
fi
cd $DOC_ROOT
mkdir -p $1/src
cat << EOT > $1/Makefile
run:
swift src/main.swift < example.txt
EOT
cat << EOT > $1/src/main.swift
let input_line=readLine()!
let splits = input_line.split(separator:" ")
print(splits)
EOT
cat << EOT > $1/example.txt
1 2
EOT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment