This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn getFileExt | |
[& *args*] (apply getFileExt *args* ) | |
[arg] (str (subs arg (.lastIndexOf arg "." ))) | |
;;This works | |
;;(getFileExt "hello.txt") | |
;;this gives me invalid number of args | |
;;(getFileExt ["hello.txt" "test.end"]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#if UNITY_EDITOR | |
using System; | |
using System.IO; | |
using System.Linq; | |
using UnityEngine; | |
using System.Collections; | |
using UnityEditor; | |
using System.Collections.Generic; | |
using Extensions; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static string CreateCode(Condition node) | |
{ | |
StringBuilder sb = new StringBuilder(); | |
sb.Append("if("); | |
while (node!=null) | |
{ | |
if(node.HasNot) | |
{ | |
sb.Append("!"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Condition | |
{ | |
public int Order {get;set;} | |
public string expression {get;set;} | |
public LogicalOperator LogicalOperator {get;set;} | |
public bool HasNot{get;set;} | |
public Condition Right {get;set;} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static Condition MoveRight(this Condition node) | |
{ | |
return node.Right; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void RecurseSet(this Node node, List<string> vals) | |
{ | |
Node tNode; | |
for(var i=0;i<vals.Count();i++) | |
{ | |
tNode = new Node(); | |
tNode.Value = vals[i]; | |
node.Right = tNode; | |
vals.Remove(vals[i]); | |
RecurseSet(tNode,vals); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static string GetValues(Node node) | |
{ | |
StringBuilder sb = new StringBuilder(); | |
while (node.Value!=null) | |
{ | |
sb.Append(node.Value); | |
node = node.Right; | |
} | |
return sb.ToString(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static Node GetRightMostNode(Node node) | |
{ | |
while(node.Value!=null) | |
{ | |
node = node.MoveRight(); | |
} | |
return node; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static Node MoveRight(this Node node) | |
{ | |
return node.Right; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Node | |
{ | |
public string Value{get;set;} | |
public Node Right {get;set;} | |
} |