假如现在突然全世界各国一起修改了法律,杀人不犯法。
从法律颁布的第一天起,大家都想先去把自己的仇家杀了,于是死一片人。随后其他人也开始慌张了,谁也不敢出门,天天在家里拿着武器瑟瑟发抖,生怕谁杀了自己。
长时间下去,各行各业停工,社会陷入混乱。
然后人们为了安全,逐渐会出现小团体,团体内一起抵制杀人,法律不管杀人,但是我们管。团体内如果谁杀人了就会被大家杀死,保护我们大家的生命安全。
于是团体会越来越多,越来越大。最终所有人都会加入团体,因为没有谁会希望自己处于一个可以随便被杀的环境之下。
最终团体就会推翻政府,重新把法律改回杀人犯法。
法律是必然形成的。
第一步,你可以杀任何人。你很爽。
马上就到了第二步,你发现自己也可能被任何一个人杀。
这时候你希望保证自己不被别人任意杀掉。怎么办呢?
于是,你和别人订了一个契约,就是我们都做到你不杀我,我不杀你。
这就是公众秩序的出现。
第三步,出现了一个人,他不守契约,他见人就杀。所有人都发现,我草,这个傻叉一出现,我们这么多人的契约白约了,能让他破坏我们所有人的成果吗?不能。
所以把他关起来,要么就杀掉。
于是,破坏公众契约,会有一个后果,一个惩罚。
法律就诞生了。
无论你怎么设置初始起点,结果都必然会这样。
有能力的自己建立一个约束条件,
用电脑仿真几个月,
不就知道结果了吗。
康威生命游戏(Conway's Game of Life),是英国数学家约翰·何顿·康威在1970年发明的细胞自动机。最初於1970年10月在《科學美國人》雜誌上馬丁·葛登能的「數學遊戲」專欄出現。
生命遊戲中,對於任意細胞,規則如下: 每個細胞有兩種狀態 - 存活或死亡,每個細胞與以自身為中心的周圍八格細胞產生互動(如圖,黑色為存活,白色為死亡) 當前細胞為存活狀態時,當周圍的存活細胞低於2個時(不包含2個),該細胞變成死亡狀態。(模擬生命數量稀少) 當前細胞為存活狀態時,當周圍有2個或3個存活細胞時,該細胞保持原樣。 當前細胞為存活狀態時,當周圍有超過3個存活細胞時,該細胞變成死亡狀態。(模擬生命數量過多) 當前細胞為死亡狀態時,當周圍有3個存活細胞時,該細胞變成存活狀態。(模擬繁殖) 可以把最初的細胞結構定義為種子,當所有在種子中的細胞同時被以上規則處理後,可以得到第一代細胞圖。按規則繼續處理當前的細胞圖,可以得到下一代的細胞圖,周而復始。
代码例子来源
https://codepen.io/RBSpatz/pen/rLyNLb
不用任何编程,懂复制粘贴就够了。
您把下面的代码内容存成一个 HTML 文件, 双击(用浏览器打开)打开就可以玩这个游戏了。
<head> <meta charset = "UTF-8" /> <title> 康威生命游戏 The Game of Life</title> </head> <body> <div id="gridContainer"> </div> <div class="controls"> <button id="start"><span>Start</span></button> <button id="clear"><span>Clear</span></button> <button id="random"><span>Random</span></button> </div> <style> body { padding: 20px; background-color: powderblue; } #gridContainer { padding-bottom: 10px; } table { background-color: #C5D6C6; border-spacing: 0; } td { border: 1px solid #F1F5DA; border-radius: 3px; width: 10px; height: 10px; } span { color: #222; } #start, #clear, #random { padding: .75em; border-radius: 5px; border: none; background: linear-gradient( to bottom right, #C5DEC6, #587559); } td.dead { background-color: transparent; } td.live { background-color: #CC4774; border-radius: 10px; } </style> <script> var rows = 79; var cols = 171; var playing = false; var grid = new Array(rows); var nextGrid = new Array(rows); var timer; var reproductionTime = 100; function initializeGrids() { for (var i = 0; i < rows; i++) { grid[i] = new Array(cols); nextGrid[i] = new Array(cols); } } function resetGrids() { for (var i = 0; i < rows; i++) { for (var j = 0; j < cols; j++) { grid[i][j] = 0; nextGrid[i][j] = 0; } } } function copyAndResetGrid() { for (var i = 0; i < rows; i++) { for (var j = 0; j < cols; j++) { grid[i][j] = nextGrid[i][j]; nextGrid[i][j] = 0; } } } // Initialize function initialize() { createTable(); initializeGrids(); resetGrids(); setupControlButtons(); } // Lay out the board function createTable() { var gridContainer = document.getElementById('gridContainer'); if (!gridContainer) { // Throw error console.error("Problem: No div for the drid table!"); } var table = document.createElement("table"); for (var i = 0; i < rows; i++) { var tr = document.createElement("tr"); for (var j = 0; j < cols; j++) {// var cell = document.createElement("td"); cell.setAttribute("id", i + "_" + j); cell.setAttribute("class", "dead"); cell.onclick = cellClickHandler; tr.appendChild(cell); } table.appendChild(tr); } gridContainer.appendChild(table); } function cellClickHandler() { var rowcol = this.id.split("_"); var row = rowcol[0]; var col = rowcol[1]; var classes = this.getAttribute("class"); if(classes.indexOf("live") > -1) { this.setAttribute("class", "dead"); grid[row][col] = 0; } else { this.setAttribute("class", "live"); grid[row][col] = 1; } } function updateView() { for (var i = 0; i < rows; i++) { for (var j = 0; j < cols; j++) { var cell = document.getElementById(i + "_" + j); if (grid[i][j] == 0) { cell.setAttribute("class", "dead"); } else { cell.setAttribute("class", "live"); } } } } function setupControlButtons() { // button to start var startButton = document.getElementById('start'); startButton.onclick = startButtonHandler; // button to clear var clearButton = document.getElementById('clear'); clearButton.onclick = clearButtonHandler; // button to set random initial state var randomButton = document.getElementById("random"); randomButton.onclick = randomButtonHandler; } function randomButtonHandler() { if (playing) return; clearButtonHandler(); for (var i = 0; i < rows; i++) { for (var j = 0; j < cols; j++) { var isLive = Math.round(Math.random()); if (isLive == 1) { var cell = document.getElementById(i + "_" + j); cell.setAttribute("class", "live"); grid[i][j] = 1; } } } } // clear the grid function clearButtonHandler() { console.log("Clear the game: stop playing, clear the grid"); playing = false; var startButton = document.getElementById('start'); startButton.innerHTML = "Start"; clearTimeout(timer); var cellsList = document.getElementsByClassName("live"); // convert to array first, otherwise, you're working on a live node list // and the update doesn't work! var cells = []; for (var i = 0; i < cellsList.length; i++) { cells.push(cellsList[i]); } for (var i = 0; i < cells.length; i++) { cells[i].setAttribute("class", "dead"); } resetGrids; } // start/pause/continue the game function startButtonHandler() { if (playing) { console.log("Pause the game"); playing = false; this.innerHTML = "Continue"; clearTimeout(timer); } else { console.log("Continue the game"); playing = true; this.innerHTML = "Pause"; play(); } } // run the life game function play() { computeNextGen(); if (playing) { timer = setTimeout(play, reproductionTime); } } function computeNextGen() { for (var i = 0; i < rows; i++) { for (var j = 0; j < cols; j++) { applyRules(i, j); } } // copy NextGrid to grid, and reset nextGrid copyAndResetGrid(); // copy all 1 values to "live" in the table updateView(); } // RULES // Any live cell with fewer than two live neighbours dies, as if caused by under-population. // Any live cell with two or three live neighbours lives on to the next generation. // Any live cell with more than three live neighbours dies, as if by overcrowding. // Any dead cell with exactly three live neighbours becomes a live cell, as if by reproduction. function applyRules(row, col) { var numNeighbors = countNeighbors(row, col); if (grid[row][col] == 1) { if (numNeighbors < 2) { nextGrid[row][col] = 0; } else if (numNeighbors == 2 || numNeighbors == 3) { nextGrid[row][col] = 1; } else if (numNeighbors > 3) { nextGrid[row][col] = 0; } } else if (grid[row][col] == 0) { if (numNeighbors == 3) { nextGrid[row][col] = 1; } } } function countNeighbors(row, col) { var count = 0; if (row-1 >= 0) { if (grid[row-1][col] == 1) count++; } if (row-1 >= 0 && col-1 >= 0) { if (grid[row-1][col-1] == 1) count++; } if (row-1 >= 0 && col+1 < cols) { if (grid[row-1][col+1] == 1) count++; } if (col-1 >= 0) { if (grid[row][col-1] == 1) count++; } if (col+1 < cols) { if (grid[row][col+1] == 1) count++; } if (row+1 < rows) { if (grid[row+1][col] == 1) count++; } if (row+1 < rows && col-1 >= 0) { if (grid[row+1][col-1] == 1) count++; } if (row+1 < rows && col+1 < cols) { if (grid[row+1][col+1] == 1) count++; } return count; } // Start everything window.onload = initialize; </script> </body>
不用任何编程,复制粘贴就够了。
您把上面的代码存成一个 HTML 文件, 双击(用浏览器打开)打开就可以玩这个游戏了。
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
俺没啥文化, 初中毕业,大伙都知道。不到一百万知友,才升10级。阅读总量只有9000万,还没跨出一小步,未及一个亿小目标。长期关注的知友知道, 俺不是专业的,也不是大佬。俺是最业余的......笑话、神棍和论坛孤儿 ⚕
这个话痨答主的其他低赞回答:
大家知道杨朱有一句话
就是,拔一毛利天下,我不干,但是取天下利自己,我也不干
注:杨朱被儒家往死里骂。主要是因为杨朱认为舍弃当今的人而去赞誉古代的先王,是赞誉枯槁的死人骨头。
其实杨朱这句话放到现在,就是,我不妨碍别人的自由,别人也不妨碍我的自由
同样的,我放弃我随意杀人的权力,换来一个我也不会随意被杀的权益
和题主设想的不同
反而是人口越多,越不会产生随意杀人
不管是玄幻小说还是仙侠小说,人口稀少的地方,那就是强者为王,看见就抢,但是都会塑造一个不允许争斗的中立性地点,主角去里边交易,采购。
没有这个地方,剧情根本完全推动不下去
仙侠世界里有炼丹的炼器的玩阵法的,要靠这种中立的地点换资源
战斗型的,也要靠这些地方来交换自己需要的弹药和法器之类
这是利益
一般作者会加一句,什么这个地方几个门派或者几个家族联手公布,动手着会被联手追杀之类的
其实就是,你不这样
就没人来了·····
没人来,就没有他们的利益了···
现实社会里,其实也是这样的
为什么说马克思是科学社会主义?
因为和空想社会主义实践,全靠个人的道德修养,大家都是好人,就行了
而马克思是从大家都是自私的人,都为了自己的利益,怎么才能利益最大化来推理的,和黄帝和老子的思想很像。
就像我经常说的一句话:“共产主义者从不向人们提出道德上的要求,例如你们应该彼此互爱呀,不要做利己主义者呀等等;相反,他们清楚地知道,无论利己主义还是自我牺牲,都是一定条件下个人自我实现的一种必要形式。”——《马克思,德意志的民族精神》
黄帝和老子的学问叫黄老之学,管仲啊萧何张良啊都是佼佼者
用张良的话说,就是我们是要适应宇宙之间的规律的(素书)
用一位黄老学派大贤的话说,就是个人的道德啊虽然重要,但是也要考虑历史的进程
这位大贤就是利用历史的进程,短短几年就拨乱反正,让国家步入了正轨。
杀人犯法的出现,其实也是大家从自己的利益出发,最后得出的最优解
而不是通过几个“圣人”的出现,让大家都讲道德,都是好人,才不随意杀人的·········
本站所有内容均为互联网搜索引擎提供的公开搜索信息,本站不存储任何数据与内容,任何内容与数据均与本站无关,如有需要请联系相关搜索引擎包括但不限于百度,google,bing,sogou 等
© 2025 tinynews.org All Rights Reserved. 百科问答小站 版权所有