I told the Founders Forum two weeks ago that the last computer program I wrote was a Sudoku solver, written in C++ several years ago (http://bit.ly/1DMK5Zk). Someone asked me for it. Here is the source code, the exe file, and a sample printout - http://bit.ly/1zAXbua
The program is pretty basic: it runs at the command prompt, in a DOS window. Type in the data line by line (e.g. 1-3-8---6), then the solver will print out the solution (or all the solutions if there are several), the number of steps the program took searching for the solution, plus some search statistics.
For techies: the program does a backtrack search, choosing the next cell to guess which minimises the fanout.
Here’s a question for those reading the source code: if x is an (binary) integer, what does (x & -x) compute?
Hope you have fun playing with this. Please tell me if you find any bugs! – LHL
#SmartNation
===========
Answer: As several of you noted, (x & –x) returns the least significant ‘1’ bit of x, i.e. the highest power of two that divides x. This assumes two’s complement notation for negative numbers, as some of you also pointed out. e.g. if x=12 (binary 1100), then (x & -x) = 4 (binary 100). I didn’t invent this; it is an old programming trick. :)
===========
Update: A few people suggested that I add a licence to the code. Have added it in the Google Drive folder.
同時也有21部Youtube影片,追蹤數超過9萬的網紅Shiney,也在其Youtube影片中提到,ซื้อเกมได้ที่ https://store.epicgames.com/legendauser/detroit-become-human Detroit: Become Human พากย์ไทย Detroit: Become Human is an upcoming actio...
「two complement」的推薦目錄:
- 關於two complement 在 Lee Hsien Loong Facebook
- 關於two complement 在 Lee Hsien Loong Facebook
- 關於two complement 在 Dr Sheikh Muszaphar FanClub Facebook
- 關於two complement 在 Shiney Youtube
- 關於two complement 在 Shiney Youtube
- 關於two complement 在 Shiney Youtube
- 關於two complement 在 【DSE ICT 概念速成】 快速二補碼計算:正負轉換、加減數 的評價
two complement 在 Lee Hsien Loong Facebook 八卦
Happy to meet President Obama again today. His regular meetings with ASEAN reflect his and America’s commitment to our region.
We last met President Obama at the ASEAN+US meeting in Kuala Lumpur last November (on.fb.me/1QEvwKY). There we raised ASEAN-US relations to a Strategic Partnership. Glad we are following up with this two-day Summit here in Sunnylands.
This afternoon we focused on how to promote an innovative, entrepreneurial ASEAN Economic Community. Singapore welcomes the US initiative to help ASEAN do this, which will complement our individual efforts.
We have much to learn from American entrepreneurial culture. I personally found my meetings with companies and personalities in Silicon Valley last week useful. Talking to Singaporeans in the Valley, it was clear that they are learning a lot and benefitting from the exposure.
Looking forward to our working dinner tonight. - LHL
(MCI Photo by Kenji Soon)
#USASEAN2016
two complement 在 Dr Sheikh Muszaphar FanClub Facebook 八卦
Pic - Seeking forgiveness from each other .
To find a spouse 4 criteria need to be looked at ...
1. Her Beauty
2. Her Wealth
3. Her Religion
4. Her Descendants
Religion comes first more than anything followed by the rest . There are additional criteria on my part which are ...
5. Her Intelligence
6. Her Health
Love is not everything on looking for a spouse .
When I met Dr Halina her beauty strucks me and her mannerism . But that wasn’t my main criteria . I looked beyond . She came from a family of 4 sibling Doctors . Her parents are some of the most honourable people I know .
Even then - it took me 8 years to finally settling down with her due to my Angkasawan Programme .
My point is that we have a choice . Marriage is a big decision and it’s not just about love . It involves both families . Each spouse needs to know their role . Give and take . Compromise .
Accept each other’s flaws .
Two strong headed spouse will certainly have a tough time. I’m full of fire and Dr Halina is like a soothing water and we complement each other . InsyaAllah ...
We have been married for 10 years now with 4 beautiful kids and InsyaAllah more to come .
May Allah grant us Jannah - Amiinn .
Selamat Hari Raya Everyone .
Love As Always ...
Just sharing ...
PS - Always seek forgiveness from each other and not just on Raya .
two complement 在 Shiney Youtube 的評價
ซื้อเกมได้ที่ https://store.epicgames.com/legendauser/detroit-become-human
Detroit: Become Human พากย์ไทย
Detroit: Become Human is an upcoming action-adventure game developed by Quantic Dream and published by Sony Interactive Entertainment for the PlayStation 4. The game will be released worldwide on 25 May 2018. The plot revolves around three androids: Kara, who escapes the factory she was made in to explore her newfound sentience; Connor, whose job it is to hunt down deviant androids; and Markus, who devotes himself to releasing the androids from servitude. They may survive or perish depending on dialogue choices that shape the story as customised by the player.
Detroit: Become Human is derived from Quantic Dream's 2012 tech demo Kara; Valorie Curry returns to reprise the title role. To research the setting, the developers visited Detroit, Michigan. Quantic Dream built a new engine to complement the game and cast hundreds of actors from Los Angeles, London and Paris before commencing the process of shooting and animation. The 2,000-page script took director David Cage more than two years to write. Philip Sheppard, Nima Fakhrara, and John Paesano composed the score for Kara, Connor, and Markus, respectively.
two complement 在 Shiney Youtube 的評價
ซื้อเกมได้ที่ https://store.epicgames.com/legendauser/detroit-become-human
Detroit: Become Human พากย์ไทย
Detroit: Become Human is an upcoming action-adventure game developed by Quantic Dream and published by Sony Interactive Entertainment for the PlayStation 4. The game will be released worldwide on 25 May 2018. The plot revolves around three androids: Kara, who escapes the factory she was made in to explore her newfound sentience; Connor, whose job it is to hunt down deviant androids; and Markus, who devotes himself to releasing the androids from servitude. They may survive or perish depending on dialogue choices that shape the story as customised by the player.
Detroit: Become Human is derived from Quantic Dream's 2012 tech demo Kara; Valorie Curry returns to reprise the title role. To research the setting, the developers visited Detroit, Michigan. Quantic Dream built a new engine to complement the game and cast hundreds of actors from Los Angeles, London and Paris before commencing the process of shooting and animation. The 2,000-page script took director David Cage more than two years to write. Philip Sheppard, Nima Fakhrara, and John Paesano composed the score for Kara, Connor, and Markus, respectively.
two complement 在 Shiney Youtube 的評價
ซื้อเกมได้ที่ https://store.epicgames.com/legendauser/detroit-become-human
Detroit: Become Human พากย์ไทย
Detroit: Become Human is an upcoming action-adventure game developed by Quantic Dream and published by Sony Interactive Entertainment for the PlayStation 4. The game will be released worldwide on 25 May 2018. The plot revolves around three androids: Kara, who escapes the factory she was made in to explore her newfound sentience; Connor, whose job it is to hunt down deviant androids; and Markus, who devotes himself to releasing the androids from servitude. They may survive or perish depending on dialogue choices that shape the story as customised by the player.
Detroit: Become Human is derived from Quantic Dream's 2012 tech demo Kara; Valorie Curry returns to reprise the title role. To research the setting, the developers visited Detroit, Michigan. Quantic Dream built a new engine to complement the game and cast hundreds of actors from Los Angeles, London and Paris before commencing the process of shooting and animation. The 2,000-page script took director David Cage more than two years to write. Philip Sheppard, Nima Fakhrara, and John Paesano composed the score for Kara, Connor, and Markus, respectively.
two complement 在 【DSE ICT 概念速成】 快速二補碼計算:正負轉換、加減數 的八卦
... <看更多>