玩具车
打开这神圣的一题,500分让我们垂涎,但是没有头绪,
打开文件听见一下一下的响声,怀疑是某种密文,看了一下尾部的图片,好像是某种电路图,百度一下
接合题意IN1就是A1,IN2就是A2,控制左前轮,同理其他文件对应各个轮子,那么接下来就是把包含在文件中的0,1,信息提取出来,在这里我参考了其他大佬的wp,借用了一个python脚本,在这比我把脚本贴出来,深刻体会到了python的强大,并会在以后的学习中深刻学习。
import wave
import numpy as np
import turtle
wavfile = wave.open('文件.wav','rb')
params = wavfile.getparams()
nchannels, sampwidth, framerate, nframes = params[:4]
sig = wavfile.readframes(nframes)
sig = np.frombuffer(sig, dtype=np.short)
seq = ''
for i in range(0,len(sig),framerate):
if sig[i] > 1000:
seq += "1"
else:
seq += "0"
file = open('文件。txt','w')
file.write(seq)
file.close()
参照上述方法依次提取各端口的信号,最后在参照以下脚本,描绘出小车的运行轨迹
各端口提取文件=''
path = ' '
front_1 = ' '
front_2 = ' '
back_1 = ' '
back_2 = ' '
for i in range(0,len(L_1_EnA)):
if L_1_EnA[i] == '1':
if L_1_A1[i] == '1' and L_1_A2[i] == '0':
front_1 = 1
elif L_1_A1[i] == '0' and L_1_A2[i] == '1':
front_1 = 2
else:
front_1 = 0
else:
front_1 = 0
if L_1_EnB[i] == '1':
if L_1_B1[i] == '1' and L_1_B2[i] == '0':
front_2 = 1
elif L_1_B1[i] == '0' and L_1_B2[i] == '1':
front_2 = 2
else:
front_2 = 0
else:
front_2 = 0
if L_2_EnA[i] == '1':
if L_2_A1[i] == '1' and L_2_A2[i] == '0':
back_1 = 1
elif L_2_A1[i] == '0' and L_2_A2[i] == '1':
back_1 = 2
else:
back_1 = 0
else:
back_1 = 0
if L_2_EnB[i] == '1':
if L_2_B1[i] == '1' and L_2_B2[i] == '0':
back_2 = 1
elif L_2_B1[i] == '0' and L_2_B2[i] == '1':
back_2 = 2
else:
back_2 = 0
else:
back_2 = 0
if front_1 == 1 and front_2 == 1 and back_1 == 1 and back_2 == 1:
path += '1'
elif front_1 == 2 and front_2 == 2 and back_1 == 2 and back_2 == 2:
path += '2'
elif front_1 == 2 and front_2 == 1 and back_1 == 2 and back_2 == 1:
path += '3'
elif front_1 == 1 and front_2 == 2 and back_1 == 1 and back_2 == 2:
path += '4'
else:
path += '5'
turtle.left(90)
for i in path:
if i == '1':
turtle.forward(5)
elif i == '2':
turtle.backward(5)
elif i == '3':
turtle.left(90)
elif i == '4':
turtle.right(90)
turtle.mainloop()
最后得到答案
总结
很酷的一道题吧,需要一定的编程基础,并且在无数次的失误里,寻找答案,当然其中少不了的是坚持与讨论,同时去搜集各种信息,这种misc最大的特点就是脑洞很大吧,就像一个侦探破案一样,首先必需要获取各方面信息,类比推理,当然,编程基本功也一定要扎实。
做这道题也犯过很多错误,比如一开始直接拿到音频放到Audacyti分析了半天
![在这里插入图片描述](https://img-blog.csdnimg.cn/20191213151324477.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2NvZGVmYW1lcg==,size_16,color_FFFFFF,t_70)
但是什么也没得到,还是最后结合了整体题意和他人脚本才解开。附参考wp添加链接描述