(日本語) Swift勉強中

func	createRandomNumber (length: Int) -> String
{
	var		seed: String	=	"0123456789"
	var		number: String	=	""

	for _ in 0..length {
		var	index	=	Int (arc4random_uniform (10)) % seed.length ()

		number	=	number	+	seed.substringAt (index: index)
		seed	=	seed.remove (from: index, length: 1)
	}
	return number
}
func	createRandomNumber (length: Int) -> String
{
	var		seed: String	=	"0123456789"
	var		number: String	=	""

	for _ in 0..length {
		var	index	=	Int (arc4random_uniform (10)) % seed.length ()

		number	=	number	+	seed.substringAt (index: index)
		seed	=	seed.remove (from: index, length: 1)
	}
	return number
}
func	createRandomNumber (length: Int) -> String
{
	var		seed: String	=	"0123456789"
	var		number: String	=	""

	for _ in 0..length {
		var	index	=	Int (arc4random_uniform (10)) % seed.length ()

		number	=	number	+	seed.substringAt (index: index)
		seed	=	seed.remove (from: index, length: 1)
	}
	return number
}
func	createRandomNumber (length: Int) -> String
{
	var		seed: String	=	"0123456789"
	var		number: String	=	""

	for _ in 0..length {
		var	index	=	Int (arc4random_uniform (10)) % seed.length ()

		number	=	number	+	seed.substringAt (index: index)
		seed	=	seed.remove (from: index, length: 1)
	}
	return number
}
func	createRandomNumber (length: Int) -> String
{
	var		seed: String	=	"0123456789"
	var		number: String	=	""

	for _ in 0..length {
		var	index	=	Int (arc4random_uniform (10)) % seed.length ()

		number	=	number	+	seed.substringAt (index: index)
		seed	=	seed.remove (from: index, length: 1)
	}
	return number
}
func	createRandomNumber (length: Int) -> String
{
	var		seed: String	=	"0123456789"
	var		number: String	=	""

	for _ in 0..length {
		var	index	=	Int (arc4random_uniform (10)) % seed.length ()

		number	=	number	+	seed.substringAt (index: index)
		seed	=	seed.remove (from: index, length: 1)
	}
	return number
}
 
This entry was posted in Off topic, Programming and tagged , , . Bookmark the permalink.

Leave a Reply