2014年10月26日 星期日

2014年10月9日 星期四

数独、すうどく 、 sūdoku

http://zh.wikipedia.org/wiki/數獨

數獨 (日語数独すうどく sūdoku)是一種邏輯性[1][2]的數字填充遊戲,玩家須以數字填進每一格,而每行、每列和每個宮(即3x3的大格)有齊1至9所有數字。遊戲設計者會提供一部份的數字,使謎題只有一個答案。


at Google 
spreadsheets

http://goo.gl/CyE6bF


Solving Every Sudoku Puzzle in Python

by Peter Norvig





:::

還有這個 是 Tkinter 版








pygame 版

http://trevorappleton.blogspot.tw/2013/10/guide-to-creating-sudoku-solver-using.html

'''
sudoku_step_8.py

get this file from
http://trevorappleton.blogspot.tw/2013/10/guide-to-creating-sudoku-solver-using.html

$ 2to3
python 2 改成 python 3

replace / to //
(實數除法 改成 整數除法)

renyuan 2014/12/02
'''

2014年9月17日 星期三

C 程式

'''
ry001.py
'''
for i in range(10): 
 print("Hello! 你好。",i)
/*
ry001.c
*/

#include 
 
main(){
 
 int i;
 for(i=0; i< 10; i+= 1){
  printf("Hello! 你好。\n");
 }
}


張Cpp.pdf 張Python.pdf

2014年9月15日 星期一

追求神乎其技的程式設計之道(一)

追求神乎其技的程式設計之道(一)





最簡單但也是最難的事情

「這個變數要叫什麼名字?」

幫變數命名時,其實就是在賦予那個變數一個「意義」。

一段好的程式碼是不需要任何額外註解或說明的。
如果名字都取得好,
每個變數就能適當的解釋了自己的角色,
每個函式都說明了自己的功能,
整個程式讀起來就會像在讀說明文件一樣自然。

命名是很難的一件事,可以說是寫程式中最接近「藝術」的一部分了。

2014年9月13日 星期六

ALGEBRA I, Multiplying and factoring expressions


https://www.khanacademy.org/math/algebra/multiplying-factoring-expression

Multiplying and factoring expressions
This topic will add a ton of tools to your algebraic toolbox. You'll be able to multiply any expression and learn to factor a bunch a well. This will allow you to solve a broad array of problems in algebra.