The Code-Bin
Links
Home
Add your code!
All Listings
About
Latest Entry
Featured Scripts
Author's Website
Latest Entries
FFMPEG Thumbnail Scr...
PHP, 0.8KB
Jul. 29, 10:24pm
John
Z80 Assembler, 190 bytes
Feb. 17, 3:36am
John
Z80 Assembler, 176 bytes
Sep. 13, 2:19am
John
Z80 Assembler, 77 bytes
Sep. 13, 2:18am
John
Z80 Assembler, 209 bytes
Sep. 13, 2:17am
untitled Smalltalk Code
Posted by: Jacob | January 10, 2011 @ 7:32pm
Smalltalk Code
[
Download
]
createFen "answers the fen diagram of the position. emptySquares is a variable which contains the number of empty squares on the rank until the next rank." | emptySquares fenString | emptySquares := 0. fenString := ''. 1 to: 8 do: [:y | y ~= 1 ifTrue: [emptySquares ~= 0 ifTrue: [fenString := fenString , emptySquares printString. emptySquares := 0]. fenString := fenString , '/'. ]. 1 to: 8 do: [:x | (squares at: x @ y) isNil ifTrue: [emptySquares := emptySquares + 1]]]. ^fenString
Syntax Highlighting
[
Open in new window
]
Author Comments
none
Rating
4.61 / 8
76 Votes
http://codebin.yi.org/1052
page generated in 0.01 seconds