惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Last Week in AI
Last Week in AI
D
DataBreaches.Net
腾讯CDC
Recent Announcements
Recent Announcements
有赞技术团队
有赞技术团队
A
About on SuperTechFans
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Google DeepMind News
Google DeepMind News
Microsoft Security Blog
Microsoft Security Blog
云风的 BLOG
云风的 BLOG
罗磊的独立博客
月光博客
月光博客
MyScale Blog
MyScale Blog
U
Unit 42
Martin Fowler
Martin Fowler
Stack Overflow Blog
Stack Overflow Blog
T
Tailwind CSS Blog
Engineering at Meta
Engineering at Meta
N
Netflix TechBlog - Medium
G
Google Developers Blog
博客园 - 【当耐特】
D
Docker
I
InfoQ
雷峰网
雷峰网

博客园 - asdsd

js收藏 - asdsd - 博客园 ArrayList最佳使用建议 右下角弹出消息 用js限制用户输入字节个数 - asdsd - 博客园 数据岛与分页 滚动条的设置 SQL中CONVERT转化函数的用法 js实现自动全屏幕 - asdsd - 博客园 迅速返回页面顶部代码 - asdsd - 博客园 图示元素的clientTop、offsetTop、offsetHeight等属性 新浪天气-模拟 揭开正则表达式 javascript中获取radiobuttonlist选中值 开发时碰到的问题以及心得经验 经常用到的javaScript技术 一劳永逸 让你与IE弹出窗口彻底告别 判断一个对象是否存在 用C#制作新闻阅读器(电脑报2005年3月14日 第10期) 遮挡的问题
随机排1-100数字
asdsd · 2006-10-27 · via 博客园 - asdsd

<html>
<head>
    
<title>JavaScript Shuffle Arithmetic</title>
    
<meta name="author" content="" />
</head>
<body>
    
<script language="javascript">
var sequence 
= new Array(100);
for ( var i=0 ; i < 100 ; i++ )
{
    aa[i] 
= i+1;
}

alert(aa(sequence));

function aa(ary)
{
    
for ( var i=ary.length-1 ; i >= 0 ; i-- )
    
{
         var v 
= parseInt(Math.random()*(i+1));
         var tmp 
= ary[v];
         ary[v] 
= ary[i];
         ary[i] 
= tmp;   
    }

    
return ary; 
}

</script>
</body>
</html>

posted on 2006-10-27 13:14  asdsd  阅读(372)  评论(0)    收藏  举报

刷新页面返回顶部