[html] js 生成文字游戏地图

2021-06-05 04:36:57 星期六
html
                    
                        
地图数据 ```javascript var map = { "001" : { "Id" : "001", "Name" : "Room 001", "Directions" : { "N" : "", "S" : "", "E" : "002", "W" : "" } }, "002" : { "Id" : "002", "Name" : "Room 002", "Directions" : { "N" : "003", "S" : "005", "E" : "", "W" : "001" } }, "003" : { "Id" : "003", "Name" : "Room 003", "Directions" : { "N" : "", "S" : "002", "E" : "004", "W" : "" } }, "004" : { "Id" : "004", "Name" : "Room 004", "Directions" : { "N" : "", "S" : "007", "E" : "", "W" : "003" } }, "005" : { "Id" : "005", "Name" : "Room 005", "Directions" : { "N" : "002", "S" : "", "E" : "006", "W" : "" } }, "006" : { "Id" : "006", "Name" : "Room 006", "Directions" : { "N" : "007", "S" : "", "E" : "", "W" : "005" } }, "007" : { "Id" : "007", "Name" : "Room 007", "Directions" : { "N" : "004", "S" : "006", "E" : "", "W" : "" } } }; ``` 生成格式如下 ```javascript /** * [003]-[004] * | | * [001]-[002] [007] * | | * [005]-[006] **/ ``` 不一定用字符串形式表示,可以用div等节点展示。
排行榜
{{v}}
  • {{k+1}}
    {{v.user_name}}
    {{v.count}}题
  • {{k+1}}
    {{v.user_name}}
    {{v.total}}题
【关注作者公众号】 以面试驱动学习--前端剑解
【公众号推荐】 不折腾的前端和咸鱼有什么区别

学习不打烊,充电加油只为遇到更好的自己,365天无节假日,每天早上5点纯手工发布前端知识点(死磕自己,愉悦大家)。希望大家在这浮夸的前端圈里,保持冷静,坚持每天花20分钟来学习与思考。在这千变万化,类库层出不穷的前端,建议大家不要等到找工作时,才狂刷题,提倡每日学习!欢迎大家关注3+1开源项目!希望大家每人去学习与思考!(不要为了谁而来,要为自己而努力!

【关注官方公众号】 每天4:30-5:00推送
【公众号推荐】 一起折腾前端算法
【微信学习群】 备注3+1