6
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Vで湯婆婆を実装してみる

Last updated at Posted at 2020-11-08

Javaで湯婆婆を実装してみる に便乗しました. 一覧はhttps://qiita.com/torifukukaiou/items/c8361231cdc56e493245 になります.

yubaba.v
import os
import rand

fn main(){
	println("契約書だよ。そこに名前を書きな。")
	name := os.get_line().ustring()
	println("フン。"+name.str()+"というのかい。贅沢な名だねぇ。")
	idx := int(rand.u32_in_range(0,u32(name.len)))
	new_name := name.substr(idx,idx+1)
	println("今からお前の名前は"+new_name+"だ。いいかい、"+new_name+"だよ。分かったら返事をするんだ、"+new_name+"!!")
}

なお,名前に何も渡さないとmax must be greater than minと出力されます.

6
2
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?