Separate client and server codes. Keep everything in one git repo for simplicity
[vchess.git] / public / javascripts / utils / array.js
diff --git a/public/javascripts/utils/array.js b/public/javascripts/utils/array.js
deleted file mode 100644 (file)
index ab1ae10..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-// Remove item in array (if present)
-var removeItem = function(array, rfun)
-{
-       let index = array.findIndex(rfun);
-       if (index >= 0)
-               array.splice(index, 1);
-}
-
-// Remove several item matching a condition
-var removeMultiple = function(array, rfun)
-{
-       // Reverse loop because of the splice below
-       for (let i=array.length-1; i>=0; i--)
-       {
-               if (rfun(array[i]))
-                       array.splice(i, 1);
-       }
-}
-
-// Double array intialization
-var doubleArray = function(size1, size2, initElem)
-{
-       return _.map(_.range(size1), () => {
-               return _.map(_.range(size2), () => {
-                       return initElem; //can be undefined
-               })
-       });
-}
-
-var copyDoubleArray = function(arr)
-{
-       return _.map(_.range(arr.length), (el1,i) => {
-               return _.map(_.range(arr[0].length), (el2,j) => {
-                       return arr[i][j];
-               })
-       });
-}