Welcome to the Treehouse Community
The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.
How do i connect two random elements from two arrays and print them together?( Swift)
I'm working on my own little project and having trouble accessing a random element from one array within a struct and another random element from another and printing those two together.
I will give you some pointers on how you could get this done!
- First you will have to figure out how to create a random number which can only go so low or so high.
- You will then have to use this random number as the index of the array.
- Finally then you will have to concatenate these two values together.
Thanks for responding, But the first two pointers are not the problem , the problem is combining the two random values and printing them in one string.
Thanks for the help!