An open API service indexing awesome lists of open source software.

https://github.com/rpdevjesco/codewarsthebattleoflists

The code for the video https://www.youtube.com/watch?v=sF0qsYBXeFc&t=5s
https://github.com/rpdevjesco/codewarsthebattleoflists

Last synced: over 1 year ago
JSON representation

The code for the video https://www.youtube.com/watch?v=sF0qsYBXeFc&t=5s

Awesome Lists containing this project

README

          

# CodeWarsTheBattleOfLists
The code for the video https://www.youtube.com/watch?v=sF0qsYBXeFc&t=5s

In order to get this code to work with Unity3D, there is a slight change you need to make for the Lists.

This is how your shuffledResults class should look.

using System.Linq;

public class ShuffledResultClass
{

public List ShuffledResults(List main, List secondary)
{

GameObject[] arr = main.ToArray();
TheShuffleClass.Shuffle(arr);
var converted = arr.Distinct().ToList();

foreach (var item in converted)
secondary.Add(item);

return secondary;
}
}

Then for the class that implements Monobehavior, it should look something like this for the basics...

public class MonoBehaviorScripting : MonoBehaviour
{

public List main;
List secondary;

void Start ()
{
secondary = new List();
ShuffledResultClass shuff = new ShuffledResultClass();
shuff.ShuffledResults(main, secondary);
for (int i = 0; i < secondary.Count; i++)
Instantiate(secondary[i] as GameObject);
}
}