【已解决】如何随机生成汉字?

Post a reply


In an effort to prevent automatic submissions, we require that you complete the following challenge.
Smilies
:D :) ;) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :!: :?: :idea: :| :mrgreen: :geek: :ugeek: :arrow: :angel: :clap: :crazy: :eh: :lolno: :problem: :shh: :shifty: :sick: :silent: :think: :thumbup: :thumbdown: :salute: :wave: :wtf: :yawn: :facepalm: :bravo: :dance: :beard: :morebeard: :xmas: :HeHe: :trollface: :cookie: :rainbow: :monkeysee: :monkeysay: :happybday: :headwall: :offtopic: :superhappy: :terms: :beer:
View more smilies

BBCode is ON
[img] is OFF
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: 【已解决】如何随机生成汉字?

Re: 如何随机生成汉字?

Post by tmplinshi » 19 Aug 2014, 05:28

谢谢!

搜索了下,汉字的 Unicode 区间是 0x4E00 -> 0x9FA5。所以代码如下:

Code: Select all

Random, n, 0x4E00, 0x9FA5
MsgBox, % Chr(n)

Re: 如何随机生成汉字?

Post by amnesiac » 18 Aug 2014, 20:14

我的想法是从汉字的 Unicode 区间中获取伪随机的编码,通过 Chr() 转汉字。
代码简单,不贴了。

PS:如果方便,对于已解决的问题请在标题前加 [SOLVED],谢谢。

【已解决】如何随机生成汉字?

Post by tmplinshi » 18 Aug 2014, 17:10

网上搜索了下“区位码转汉字”,但是没弄明白 :|

Top