Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
174 views
in Technique[技术] by (71.8m points)

sorting - Changing an arrays output depending on previous lists randomly selected value

So, I have to program in the dreaded realm of block coding (The language is called "Snap!" it is based on MiT's Scratch's language, in fact it's literally like a clone) for an AP class of mine, rather than Java or Python, which is what I'm used to. I've noticed this particular IDE isn't very good, especially that the program output is a visual stage rather than text-based. So, I have an assignment, and in this assignment, I must re-create my D&D Character generator in this language, which was programmed in Java. Because of how drastically different the two environments are it's hard to translate the code and processes. In this program, it generates an array (Snap calls them lists for whatever reason) that has smaller arrays inside of it for race, identity/gender, class, age, origin, etc. So, I have it set so that if a character's race is a 'Changeling,' the identity of said character is changed to display 'neutral' (As Changelings are dopplegangers, they don't have a gender in canon) rather than the standard 'male' or 'female' for all other races. This was very easy to program when I first did this in Java, but because of how drastically different Snap is, I am having quite the difficulty rebuilding this in Snap. An example of what I'm trying to do should be attatched here as a photo of the incomplete script (Block :p). Any help is appreciated. I'm sure it's just because I'm not used to this type of programming, or some other small inconsistency. Script Picture of Array Generation

question from:https://stackoverflow.com/questions/66065980/changing-an-arrays-output-depending-on-previous-lists-randomly-selected-value

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...