我正在尝试使用Swift为iPhone创建一个单词jumbler游戏.我对编程和Swift比较陌生,但以前用Python创建过这个游戏.
这是我的伪代码:
//select RANDOM WORD from array
//determine the number of characters in the RANDOMLY SELECTED WORD
//randomly select a NUMBER within the boundries of the number of characters (i.e. if the word is "apple," select a number between 0 and 4)
//select the CHARACTER that corresponds to the randomly selected NUMBER
//add the CHARACTER to a new string (JUMBLE)
//remove the CHARCATER from the RANDOMLY SELECTED WORD
//Repeat until the RANDOM WORD is empty
Run Code Online (Sandbox Code Playgroud)
到目前为止,这是我的代码:
导入UIKit
//this is my …Run Code Online (Sandbox Code Playgroud)