Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
Help us understand the problem. What is going on with this article?

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

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と出力されます.

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away