If you have a problem or need to report a bug please email : support@dsprobotics.com
There are 3 sections to this support area:
DOWNLOADS: access to product manuals, support files and drivers
HELP & INFORMATION: tutorials and example files for learning or finding pre-made modules for your projects
USER FORUMS: meet with other users and exchange ideas, you can also get help and assistance here
NEW REGISTRATIONS - please contact us if you wish to register on the forum
Users are reminded of the forum rules they sign up to which prohibits any activity that violates any laws including posting material covered by copyright
Int Array Help
11 posts
• Page 1 of 2 • 1, 2
Int Array Help
Hello guys. Can somebody help me with small problem? I need to swap values in integer arrays. I know ho to easilly do this in ruby but i need solution with green primitives since i dont want to use ruby at all.
I need this for module/effect ordering. So for example I have array with six integers 0,1,2,3,4,5 and i need to swap two choosen values. For example 0 with 3. I have tried to do it by myself but no good working soluton.
I need this for module/effect ordering. So for example I have array with six integers 0,1,2,3,4,5 and i need to swap two choosen values. For example 0 with 3. I have tried to do it by myself but no good working soluton.
-
TrojakEW - Posts: 111
- Joined: Sat Dec 25, 2010 10:12 am
- Location: Slovakia
Re: Int Array Help
Inside the Developer toolkit in the Array section is a "Sort integer array" module, have a look at that it uses swapping to sort the array. Maybe you can learn from or modify it for your needs.
- Exo
- Posts: 426
- Joined: Wed Aug 04, 2010 8:58 pm
- Location: UK
Re: Int Array Help
Thanks you guys. I will check booth and see what is best for me.
-
TrojakEW - Posts: 111
- Joined: Sat Dec 25, 2010 10:12 am
- Location: Slovakia
Re: Int Array Help
Well I found the same problem in booth version and in my own attempt too while swaping the array. Problem is when I want to use array from output again for another swap. Look in attached file - I used Yoleen example. Try to change index few time and you will see the problem. It will add same value to two indexes after 2 or more changes. How to fix that?
- Attachments
-
- Swap_loop.fsm
- (488 Bytes) Downloaded 778 times
-
TrojakEW - Posts: 111
- Joined: Sat Dec 25, 2010 10:12 am
- Location: Slovakia
Re: Int Array Help
Hmm, perhaps a trigger order issue? Here is an alternative using code instead of green.
- Attachments
-
- SwapIntArray.fsm
- (766 Bytes) Downloaded 810 times
-
martinvicanek - Posts: 1328
- Joined: Sat Jun 22, 2013 8:28 pm
Re: Int Array Help
here is a green version which should work correct
- Attachments
-
- Swap_array_elements_green.fsm
- (578 Bytes) Downloaded 775 times
-
Nubeat7 - Posts: 1347
- Joined: Sat Apr 14, 2012 9:59 am
- Location: Vienna
Re: Int Array Help
This should work correctly now in loop.
- Attachments
-
- Swap V2.fsm
- (486 Bytes) Downloaded 778 times
- Youlean
- Posts: 176
- Joined: Mon Jun 09, 2014 2:49 pm
Re: Int Array Help
Thanks. Going to test them today.
-
TrojakEW - Posts: 111
- Joined: Sat Dec 25, 2010 10:12 am
- Location: Slovakia
Re: Int Array Help
My version is quite similar to Nubeat7's...
- Attachments
-
- Swap (MyCo).fsm
- (1.24 KiB) Downloaded 757 times
-
MyCo - Posts: 718
- Joined: Tue Jul 13, 2010 12:33 pm
- Location: Germany
11 posts
• Page 1 of 2 • 1, 2
Who is online
Users browsing this forum: No registered users and 116 guests