TC官方合作论坛

 找回密码
 立即注册
查看: 2144|回复: 3

淘宝答题器,简单版

[复制链接]
发表于 2013-9-6 10:33:23 | 显示全部楼层 |阅读模式

马上加入TC

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
  1. namespace TBDT

  2. thread1
  3. timu = array[]
  4. daan = array[]
  5. quantimu = array[]
  6. //三个数组,用来记录,减少运行时间

  7. function main()  //个函数是主函数
  8.     i = 1
  9.     handle1 = file.openfile("rc:题目.txt")
  10.     handle2 = file.openfile("rc:答案.txt")
  11.     handle3 = file.openfile("rc:淘宝题目.txt")
  12.     //打开文件,获得文件句柄,为下面的读取做准备
  13.     while(true)
  14.         text = file.readfileline(handle1)
  15.         daantext = file.readfileline(handle2)
  16.         timutext = file.readfileline(handle3)
  17.         if(text == "")
  18.             break
  19.         endif
  20.         list.addstring("list0",timutext)
  21.         arraysp.add(timu, text, 1)
  22.         arraysp.add(daan, daantext, 1)
  23.         arraysp.add(quantimu, timutext, 1)
  24.         //把题目,答案,预存入数组中,用于遍历
  25.     endwhile
  26.     file.closefile(handle1)
  27.     file.closefile(handle2)
  28.     file.closefile(handle3)
  29. endfunction

  30. function Clear(strtext) //清楚题目中的字符,方便查找
  31.     strtext = str.strcut(strtext,4, true)
  32.     strtext = str.strcut(strtext,2, false)
  33.     str1 = str.replace(strtext,",","")
  34.     str2 = str.replace(str1, "、", "")
  35.     str3 = str.replace(str2, ":", "")
  36.     str4 = str.replace(str3,",","")
  37.     str5 = str.replace(str4, ":", "")
  38.     return str5
  39. endfunction

  40. function start_click()
  41.     text = edit.gettext("edit0")
  42.     retext = TBDT.Clear(text) //清理上次的搜素记录
  43.     len
  44.     arraysp.size(timu,len)
  45.     list.deleteall("list1")
  46.     for(i=0;i<len;i++)
  47.         if(str.findstr(timu[i], retext) >= 0)
  48.             list.addstring("list1",quantimu[i])
  49.             list.addstring("list1", daan[i])
  50.         endif
  51.     endfor
  52. endfunction

  53. function exit_click()
  54.     thread.closethread(thread1)
  55.     help.exit()
  56. endfunction


  57. function init()
  58.         thread1 = thread.beginthread("TBDT.main","")
  59. endfunction


  60. function edit0_setfocus()
  61.         edit.settext("edit0","")
  62.         //编辑框点击时,清楚上次的查找内容
  63. endfunction

  64. endnamespace
复制代码
http://pt.tyuyan.com/soft-FB98085F9F8D6D0FB8A4500A24A36743淘宝答题的平台链接

淘宝.rar (11.94 KB, 下载次数: 28)
回复

使用道具 举报

发表于 2013-9-6 13:55:29 | 显示全部楼层
感觉好厉害的样子哦
回复 支持 反对

使用道具 举报

发表于 2013-9-6 17:38:24 | 显示全部楼层
看看~老师又发什么好东西~好像不错的样子~~~~~
回复 支持 反对

使用道具 举报

发表于 2013-9-30 17:16:47 | 显示全部楼层
英文的看不懂啊啊啊啊啊
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

推荐上一条 /2 下一条

关闭

小黑屋|TC官方合作论坛 (苏ICP备18045623号)

GMT+8, 2024-5-18 04:46 , Processed in 0.049002 second(s), 25 queries .

Powered by 海安简单软件服务部

© 2008-2019 版权所有 保留所有权利

快速回复 返回顶部 返回列表