[{"createTime":1735734952000,"id":1,"img":"hwy_ms_500_252.jpeg","link":"https://activity.huaweicloud.com/cps.html?fromacct=261f35b6-af54-4511-a2ca-910fa15905d1&utm_source=V1g3MDY4NTY=&utm_medium=cps&utm_campaign=201905","name":"华为云秒杀","status":9,"txt":"华为云38元秒杀","type":1,"updateTime":1735747411000,"userId":3},{"createTime":1736173885000,"id":2,"img":"txy_480_300.png","link":"https://cloud.tencent.com/act/cps/redirect?redirect=1077&cps_key=edb15096bfff75effaaa8c8bb66138bd&from=console","name":"腾讯云秒杀","status":9,"txt":"腾讯云限量秒杀","type":1,"updateTime":1736173885000,"userId":3},{"createTime":1736177492000,"id":3,"img":"aly_251_140.png","link":"https://www.aliyun.com/minisite/goods?userCode=pwp8kmv3","memo":"","name":"阿里云","status":9,"txt":"阿里云2折起","type":1,"updateTime":1736177492000,"userId":3},{"createTime":1735660800000,"id":4,"img":"vultr_560_300.png","link":"https://www.vultr.com/?ref=9603742-8H","name":"Vultr","status":9,"txt":"Vultr送$100","type":1,"updateTime":1735660800000,"userId":3},{"createTime":1735660800000,"id":5,"img":"jdy_663_320.jpg","link":"https://3.cn/2ay1-e5t","name":"京东云","status":9,"txt":"京东云特惠专区","type":1,"updateTime":1735660800000,"userId":3},{"createTime":1735660800000,"id":6,"img":"new_ads.png","link":"https://www.iodraw.com/ads","name":"发布广告","status":9,"txt":"发布广告","type":1,"updateTime":1735660800000,"userId":3},{"createTime":1735660800000,"id":7,"img":"yun_910_50.png","link":"https://activity.huaweicloud.com/discount_area_v5/index.html?fromacct=261f35b6-af54-4511-a2ca-910fa15905d1&utm_source=aXhpYW95YW5nOA===&utm_medium=cps&utm_campaign=201905","name":"底部","status":9,"txt":"高性能云服务器2折起","type":2,"updateTime":1735660800000,"userId":3}]
<> 羊了个羊过关思路
<>9.16重大更新
此题放弃了,这题无解。出题的随机性很大,到最后根本凑不成三个相同的。将近百分之一的有解率。坑人的游戏
<>前言
肝了几遍微信小程序“羊了个羊“,发现有大概的解题思路,需要用代码敲一下子。遂先写一下思路,有空的话代码实践一下子。
游戏胜利机制为消除背景上方所有图标,消除方法为点击三个相同的图标,难点在于当有超过三个相同图标时,需要考虑图标下一层掩盖的图标,从而实现最优选择。
总体来讲,分几大方面:
<>1.堆栈
堆栈实行先入后出原则,对应游戏里最下方的土坑样的储存空间,因此允许先存储暂时无法进行消除的图标。
stack = [] 容量最多有7个,因此允许前四个图标不相同,但最后三个必须相同 当栈内检测到有三个相同图标时,进行出栈
<>2.Mask掩膜
主要焦点为高亮图标对暗处图标进行了一定程度的遮挡,通过图像识别对遮挡图标进行检测。
* 检测高亮显示的图标
* 检测被遮挡图标
* 检测该层是否有可三连消除的图标
* 更新图片,重新检测
<>3.识别
* 识别高亮图标类别
* 根据部分特征识别被遮挡图标类别
* 标记被遮挡图标位置 imoport cv 利用OpenCV进行图像检测、识别
<>4.判断
* 判断高亮图标消失后,可以将哪些”暗图标“变为”亮图标“
<>5.强化学习
奖励机制正在探索中
<>6.代码思路
注意只有思路
# 当前高亮显示的图标及对应位置 high_light_pic = [水桶,剪刀,饭团,饭团,饭团] high_light_pic_xy = [[123,
321],[111,222],[333,444],[678,321],[555,666]] if high_light_pic能进行三消:
找到三个相同图标,进行消除else: 选择一个亮图标,该图标需具备入栈后其掩盖的暗图标可以实现三消的能力。