JSRUN 用代码说话
{
    "AD": "安道尔",
    "AE": "阿联酋",
    "AF": "阿富汗",
    "AG": "安提瓜和巴布达",
    "AI": "安圭拉",
    "AL": "阿尔巴尼亚",
    "AM": "亚美尼亚",
    "AN": "荷属安的列斯群岛",
    "AO": "安哥拉",
    "AR": "阿根廷",
    "AS": "美属萨摩亚",
    "AT": "奥地 利",
    "AU": "澳大利亚",
    "AW": "阿鲁巴群岛",
    "AZ": "阿塞拜疆",
    "BA": "波斯尼亚",
    "BB": "巴巴多斯",
    "BD": "孟加拉",
    "BE": "比利时",
    "BF": "布基纳法索",
    "BG": "保加利亚",
    "BH": "巴林",
    "BI": "布隆迪",
    "BJ": "贝宁",
    "BL": "圣巴瑟米(法 )",
    "BM": "百慕大",
    "BN": "文莱",
    "BO": "玻利维亚",
    "BQ": "荷兰加勒比区",
    "BR": "巴西",
    "BS": "巴哈马",
    "BT": "不丹",
    "BV": "布韦岛(挪)",
    "BW": "博茨瓦纳",
    "BY": "白俄罗斯",
    "BZ": "伯利兹",
    "CA": "加拿大",
    "CC": "科科斯群岛",
    "CD": "刚果民主共和国",
    "CF": "中非共和国",
    "CG": "刚果",
    "CH": "瑞士",
    "CI": "科特迪瓦",
    "CK": "库克群岛",
    "CL": "智利",
    "CM": "喀麦隆",
    "CN": "中国",
    "CO": "哥伦比亚",
    "CR": "哥斯达黎加",
    "CU": "古巴",
    "CV": "佛得角",
    "CW": "库拉索",
    "CX": "圣诞岛",
    "CY": "塞浦路斯",
    "CZ": "捷克",
    "DE": "德国",
    "DJ": "吉布提",
    "DK": "丹麦",
    "DM": "多米尼克",
    "DO": "多米尼加",
    "DZ": "阿尔及利亚",
    "EC": "厄瓜多尔",
    "EE": "爱沙尼亚",
    "EG": "埃及",
    "EH": "西撒哈拉",
    "ER": "厄立特里 亚",
    "ES": "西班牙",
    "ET": "埃塞俄比亚",
    "EU": "欧盟",
    "FI": "芬兰",
    "FJ": "斐济",
    "FK": "福克兰群岛(马尔维纳斯群岛)",
    "FM": "密克罗尼西亚联邦",
    "FO": "法罗群岛",
    "FR": "法国",
    "GA": "加蓬",
    "GB": "英国",
    "GD": "格林纳达",
    "GE": "格鲁吉亚",
    "GF": "法属圭亚那",
    "GG": "格恩西岛",
    "GH": "加纳",
    "GI": "直布罗陀",
    "GL": "格陵兰",
    "GM": "冈比亚",
    "GN": "几内亚",
    "GP": "瓜德罗普",
    "GQ": "赤道几内亚",
    "GR": "希腊",
    "GS": "南乔治亚岛",
    "GT": "危地马拉",
    "GU": "关岛",
    "GW": "几内亚比绍",
    "GY": "圭亚那",
    "HK": "中国香港",
    "HM": "赫德岛和麦克唐纳群岛",
    "HN": "洪都拉斯",
    "HR": "克罗地亚",
    "HT": "海地",
    "HU": "匈牙利",
    "ID": "印度尼西亚",
    "IE": "爱尔兰",
    "IL": "以色列",
    "IN": "印度",
    "IO": "英属 印度洋领地",
    "IQ": "伊拉克",
    "IR": "伊朗",
    "IS": "冰岛",
    "IT": "意大利",
    "JM": "牙买加",
    "JO": "约旦",
    "JP": "日本",
    "KE": "肯尼亚",
    "KG": "吉尔吉斯斯坦",
    "KH": "柬埔寨",
    "KI": "基里巴斯",
    "KM": "科摩罗",
    "KN": "圣基茨和尼维斯",
    "KP": "朝鲜",
    "KR": "韩国",
    "KV": "科索沃",
    "KW": "科威特",
    "KY": "开曼群岛",
    "KZ": "哈萨克斯坦",
    "LA": "老挝",
    "LB": "黎巴嫩",
    "LC": "圣卢西亚",
    "LI": "列支敦士登",
    "LK": "斯里兰卡",
    "LR": "利比里亚",
    "LS": "莱索托",
    "LT": "立陶宛",
    "LU": "卢森堡",
    "LV": "拉脱维亚",
    "LY": "利比亚",
    "MA": "摩洛哥",
    "MC": "摩纳哥",
    "MD": "摩尔多瓦",
    "ME": "黑山",
    "MG": "马达加斯加",
    "MH": "马绍尔群岛",
    "MK": "马其顿",
    "ML": "马里",
    "MM": "缅甸",
    "MN": "蒙古",
    "MO": "中国澳门",
    "MP": "北马里亚纳群岛",
    "MQ": "马提尼克",
    "MR": "毛里塔尼亚",
    "MS": "蒙特塞拉特",
    "MT": "马耳他",
    "MU": "毛里求斯",
    "MV": "马尔代夫",
    "MW": "马拉维",
    "MX": "墨西哥",
    "MY": "马来西亚",
    "MZ": "莫桑比克",
    "NA": "纳米比亚",
    "NC": "新喀里多尼亚",
    "NE": "尼日尔",
    "NF": "诺福克岛",
    "NG": "尼日利亚",
    "NI": "尼加拉瓜",
    "NL": "荷兰",
    "NO": "挪威",
    "NP": "尼泊尔",
    "NR": "瑙鲁",
    "NU": "纽埃",
    "NZ": "新西兰",
    "OM": "阿曼",
    "PA": "巴拿马",
    "PE": "秘鲁",
    "PF": "法属波利尼西亚",
    "PG": "巴布亚新几内亚",
    "PH": "菲律宾",
    "PK": "巴基斯坦",
    "PL": "波兰",
    "PM": "圣皮埃尔和密克隆",
    "PN": "皮特凯恩",
    "PR": "波多黎各",
    "PS": "加沙地带",
    "PT": "葡萄牙",
    "PW": "帕劳",
    "PY": "巴拉圭",
    "QA": "卡塔尔",
    "RE": "留尼旺群岛",
    "RO": "罗马尼亚",
    "RS": "塞尔维亚",
    "RU": "俄罗斯",
    "RW": "卢旺达",
    "SA": "沙特阿拉伯",
    "SB": "所罗门群岛",
    "SC": "塞舌尔",
    "SD": "苏丹",
    "SE": "瑞典",
    "SG": "新加坡",
    "SH": "圣赫勒拿,阿森松岛和特里斯坦达库尼亚",
    "SI": "斯洛 文尼亚",
    "SJ": "斯瓦尔巴特群岛",
    "SK": "斯洛伐克",
    "SL": "塞拉利昂",
    "SM": "圣马力诺",
    "SN": "塞内加尔",
    "SO": "索马里",
    "SR": "苏里南",
    "SS": "南苏丹",
    "ST": "圣多美和普林西比",
    "SV": "萨尔瓦多",
    "SX": "荷属圣马丁",
    "SY": "叙利 亚",
    "SZ": "斯威士兰",
    "TC": "特克斯和凯科斯群岛",
    "TD": "乍得",
    "TG": "多哥",
    "TH": "泰国",
    "TJ": "塔吉克斯坦",
    "TK": "托克劳群岛",
    "TL": "东帝汶",
    "TM": "土库曼斯坦",
    "TN": "突尼斯",
    "TO": "汤加",
    "TR": "土耳其",
    "TT": "特里尼达 和多巴哥",
    "TV": "图瓦卢",
    "TW": "中国台湾",
    "TZ": "坦桑尼亚",
    "UA": "乌克兰",
    "UG": "乌干达",
    "UM": "美国本土外小岛屿",
    "US": "美国",
    "UY": "乌拉圭",
    "UZ": "乌兹别克斯坦",
    "VA": "梵蒂冈",
    "VC": "圣文森特和格林纳丁斯",
    "VE": "委 内瑞拉",
    "VG": "英属维尔京群岛",
    "VI": "维京群岛",
    "VN": "越南",
    "VU": "瓦努阿图",
    "WF": "瓦利斯群岛和富图纳群岛",
    "WS": "萨摩亚",
    "YE": "也门",
    "YT": "马约特岛",
    "ZA": "南非",
    "ZM": "赞比亚",
    "ZW": "津巴布韦"
}
dolacmeo(哆啦酱) - 2020-07-08 0 人
地理缩写对照
{
    "color": "#f56c6c",
    "type": "line",
    "data": {
        "current": "105",
        "totla": "375"
    }
}
maoguotai(、Sean) - 2020-07-03 0 人
列表json代码
  
       function Point()
       {
           this.x=0;
           this.y=0;
           this.G=0; //G值 开始点 到当前点的移动量
           this.H=0; //H值 当前点移动目的地的移动量估算值
           this.value = 0; //当前点的权重
           this.father=null;
};
       Point.prototype={
           Console:function(){
               console.log("x:"+this.x+" and y:"+this.y);
    },
           Init:function(x,y,father){
               this.x = x;
               this.y = y;
               this.father = father;
    }
};
       function AStar(){
    //地图存放二维数组
           this.map=[];
           //行数
           this.rowCount=0;
           //列数
           this.colCount=0;
           //出发点
           this.startPoint=new Point();
           //终点
           this.endPoint=new Point();
           //存放Opint类的open数组
           this.openList=[];
           //存在Opint类的close数组
           this.closeList=[];
};
       AStar.prototype={
    //是否为障碍物
           IsBar:function(x,y){
               if(this.map[x
        ][y
        ]==3){
                   console.log("bar...");
                   return true;
        }
               else{
                   console.log("no bar...")
                   return false;
        }
    },
    //当前坐标是否在OpenList
           IsInOpenList:function(x,y){
                for(var i=0;i<this.openList.length;i++){
                    if(this.openList[i
            ].x == x && this.openList[i
            ].y == y) {
                        return true;
            }
        }
               return false;
    },
    //当前坐标是否在CloseList
           IsInCloseList:function(x,y){
               for(var i=0;i<this.closeList.length;i++){
                   if(this.closeList[i
            ].x == x&& this.closeList[i
            ].y == y) {
                       return true;
            }
        }
               return false;
    },
    //计算G值;(p是Point类)
           GetG:function(p) {
               if(p.father==null){
                   return 0;
        }
               return p.father.G + levelMap[p.x
        ][p.y
        ];
    },
    //计算H值
           GetH:function(p,pb){
               var h = 0;
               if(p.x >= pb.x && p.y >= pb.y) {
                  for(var i = pb.x; i <= p.x; i++) {        
                      h += levelMap[i
                ][p.y
                ];
            }
                  for(var j = pb.y; j <= p.y; j++) {
                      h += levelMap[pb.x
                ][j
                ];
            }
                  return h;
        } else if(p.x >= pb.x && p.y <= pb.y) {
                  for(var i = pb.x; i <= p.x; i++) {
                      h +=  levelMap[i
                ][p.y
                ];
            }
                  for(var j = p.y; j <= pb.y; j++) {
                      h += levelMap[pb.x
                ][j
                ];
            }                 
                  return h;
        } else if(p.x <= pb.x && p.y >= pb.y) {
                  for(var i = p.x; i <= pb.x; i++) {
                      h += levelMap[i
                ][p.y
                ];
            }
                  for(var j = p.y; j <= pb.y; j++) {
                      h += levelMap[pb.x
                ][j
                ];
            }
                  return h;
        } else if(p.x <= pb.x && p.y <= pb.y) {
                  for(var i = p.x; i <= pb.x; i++){
                      h += levelMap[i
                ][p.y
                ];
            }
                  for(var j = p.y; j <= pb.y; j++){
                      h += levelMap[pb.x
                ][j
                ];
            }
                  return h;
        }
        //return Math.abs(p.x-pb.x)+Math.abs(p.y-pb.y);
    },
    //添加当前点的上下左右相邻的方格到Open列表中
           AddNeiToOpenList: function(curPoint) {
               for(var x = curPoint.x-1; x <= (+curPoint.x+1); x++){
                    for(var y = curPoint.y-1; y <= (+curPoint.y+1); y++){
                //排除自身以及超出下标的点
                        if((x >= 0 && x < this.colCount && y >= 0 && y < this.rowCount) && !(curPoint.x == x && curPoint.y == y)){
                    //排除斜对角
                            if(Math.abs(x-curPoint.x) + Math.abs(y-curPoint.y) == 1){
                        //不是障碍物且不在关闭列表中
                                if(this.IsBar(x,y)== false && this.IsInCloseList(x,y) == false) {
                            //不存在Open列表
                                    if(this.IsInOpenList(x,y) == false) {
                                        var point=new Point();
                                        point.x = x;
                                        point.y = y;
                                        point.father = curPoint;
                                        point.G = this.GetG(point);
                                        point.H=this.GetH(point,this.endPoint);
                                        this.openList.push(point);
                            }
                            //存在open表中,需要重新计算G值 
                                    else {
                                      var point = this.GetPointFromOpenList(x, y);      
                                      //如果从当前点移动到已经在open表中的该点G值变小,更新该点G值以及父节点                                
                                      if((curPoint.G + point.value) < point.G) {
                                        point.father = curPoint;
                                        point.G = curPoint.G + point.value;
                                }
                            }
                        }
                    }
                }
            }
        }
    },
    //在openlist集合中获取G+H为最小的Point点
           GetMinFFromOpenList:function(){
               var minPoint=null;
               var index=0;
               for(var i = 0; i < this.openList.length; i++) {
                   if(minPoint == null || minPoint.G + minPoint.H >= this.openList[i
            ].G + this.openList[i
            ].H) {
                       minPoint=this.openList[i
                ];
                       index=i;
            }
        }
               return{
                   minPoint: minPoint,
                   index: index
        }
    },
 
           GetPointFromOpenList:function(x,y){
               for(var i = 0; i < this.openList.length; i++) {
                   if(this.openList[i
            ].x == x && this.openList[i
            ].y == y) {
                       return this.openList[i
                ];
            }
        }
               return null;
    },
    //开始寻找节点
           FindPoint:function(){
              console.time("time2")
               this.openList.push(this.startPoint);
               while(this.IsInOpenList(this.endPoint.x, this.endPoint.y) == false || this.openList.length == 0) {
                   var curPoint = this.GetMinFFromOpenList().minPoint;
                   console.log("curPoint:"+curPoint);
                   var index=this.GetMinFFromOpenList().index;
                   if(curPoint==null){
                       console.log("没有路");
                       return;
            }
                   this.openList.splice(index,
            1);
                   this.closeList.push(curPoint);
                   this.AddNeiToOpenList(curPoint);
        }

               var p = this.GetPointFromOpenList(this.endPoint.x, this.endPoint.y);

               while(p.father!=null){
                   p = p.father;
                   this.map[p.x
            ][p.y
            ]=4;
        }
        //把终结点也设置成4
               this.map[this.endPoint.x
        ][this.endPoint.y
        ]=4;
            	 console.timeEnd("time2")
    },
           PrintMap:function(){}
};

       //地图类    map数组保存数字标识 :0 默认 1 开始点 2 结束点 3 障碍物
       function Map(id){
           this.map=[];
           this.container=document.getElementById(id);
           this.colCount=0;
           this.rowCount=0;
}
       var levelMap = [];
       Map.prototype = {
           init:function(colCount,rowCount) {
               this.colCount = colCount;
               this.rowCount = rowCount;
               for(var colIndex = 0; colIndex < this.colCount;colIndex++){
                   this.map.push([]);
                   //权重数组
                   levelMap.push([]);
                   for(var rowIndex=0;rowIndex<this.rowCount;rowIndex++){
                       this.map[colIndex
                ].push(0);
                       levelMap[colIndex
                ].push(Math.random()*10);
            }
        }
    },
           drawMap:function(callback){
               for(var colIndex=0;colIndex<this.map.length;colIndex++){
                   for(var rowIndex=0;rowIndex<this.map[colIndex
            ].length;rowIndex++){
                       var div=document.createElement("div");
                       div.style.top=colIndex*50+5+"px";
                       div.style.left=rowIndex*50+5+"px";
                       div.setAttribute("colIndex",colIndex);
                       div.setAttribute("rowIndex",rowIndex);
                       div.onclick=callback;
                       this.container.appendChild(div);
            }
        }
    },
           drawPoints:function(){
               var divs=this.container.children;
               console.log(divs.length);
               console.log(this.map);
               var timer=1000;
               for(var i=0;i<divs.length;i++){
                   var colIndex=divs[i
            ].getAttribute("colIndex");
                   var rowIndex=divs[i
            ].getAttribute("rowIndex");
                   if(this.map[colIndex
            ][rowIndex
            ]==4){
                       divs[i
                ].style.backgroundColor="red";
            }
        }
    },
           getPoint:function(colIndex,rowIndex){
               return this.map[colIndex
        ][rowIndex
        ];
    },
           setStartPoint:function(colIndex,rowIndex){
               this.map[colIndex
        ][rowIndex
        ]=1;
    },
           setEndPoint:function(colIndex,rowIndex){
               this.map[colIndex
        ][rowIndex
        ]=2;
    },
           setBarPoint:function(colIndex,rowIndex){
               this.map[colIndex
        ][rowIndex
        ]=3;
    },
           clearMap:function(){
               this.map.splice(0,this.map.length);
               this.container.innerHTML="";
    }
}
 
       var rowInput=document.querySelector("#rowInput");
       var colInput=document.querySelector("#colInput");
       var createMapBtn=document.querySelector("#createMapBtn");
       var prompt=document.querySelector("#prompt");
       var findPoint=document.querySelector("#findPoint");
       var curMap=new Map("main");
       var state=0; //状态标识 0选择开始节点标识 1选择结束节点标识 2选择障碍物标识
       var aStar=new AStar(); //寻路类
 
       createMapBtn.onclick=function(){
 
           curMap.clearMap();
           curMap.init(colInput.value,rowInput.value);
           aStar.map=curMap.map;
           aStar.colCount=colInput.value;
           aStar.rowCount=rowInput.value;
           curMap.drawMap(function(){
                var colIndex=this.getAttribute("colIndex");
                var rowIndex=this.getAttribute("rowIndex");
                if(curMap.getPoint(colIndex,rowIndex)!=0){
                    return;
        }
                if(state==0){
                    this.style.backgroundColor="blue";
                    curMap.setStartPoint(colIndex,rowIndex);
                    aStar.startPoint.x = colIndex;
                    aStar.startPoint.y = rowIndex;
                    aStar.startPoint.value = levelMap[colIndex
            ][rowIndex
            ];
                    state=1;
                    prompt.innerHTML="请点击格子,设置终点";
        }else if(state==1){
                    this.style.backgroundColor="yellow";
                    curMap.setEndPoint(colIndex,rowIndex);
                    aStar.endPoint.x=colIndex;
                    aStar.endPoint.y=rowIndex;
                    prompt.innerHTML="请点击格子,设置障碍物";
                    console.log(findPoint);
                    findPoint.style.display="block";
                    state=2;
        }else if(state==2){
                    curMap.setBarPoint(colIndex,rowIndex);
                    this.style.backgroundColor="black";
        }
    });
           prompt.innerHTML="请点击格子,设置起始点";
}
       findPoint.onclick=function(){
           aStar.FindPoint();
           curMap.drawPoints();
}
jiajia1999(佳佳) - 2020-07-03 0 人
A*算法运行
{
  "log" : {
    "access": "/var/log/v2ray/access.log",
    "error": "/var/log/v2ray/error.log",
    "loglevel": "warning"
  },
  "inbounds": [{
    "port": 8888,
    "protocol": "vmess",
    "settings": {
      "clients": [
        {
          "id": "60ca58e9-003e-4c01-98de-c2223ae49153",
          "level": 1,
          "alterId": 64
        }
      ]
    },
    "streamSettings": {
        "wsSettings": {
          "path": "/ws",
          "headers": {
            "Host": "github.com"
          }
        },
        "network": "ws"
    }
  }],
  "outbounds": [{
    "protocol": "freedom",
    "settings": {}
  }]
}
chinazman(前端大神) - 2020-06-25 0 人
v2ray-config
{
    "title": "JSON在线解析,JSON格式化",
    "url": [
        "http://jsonview.net",
        "http://json.jsrun.net",
        "http://jsrun.net/json/new"
    ],
    "share": "JSON格式化工具您要是觉得这个工具不错,请推荐给您的好友",
    "author": "JSRUN.NET"
}
chenzhongpei(心雨) - 2020-06-20 0 人
JSON在线解析,JSON格式化
没有了
1/1
没有了