mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2025-12-23 07:29:02 -08:00
Added MiniScript port of 32_Diamond
This commit is contained in:
3
00_Alternate_Languages/32_Diamond/MiniScript/README.md
Normal file
3
00_Alternate_Languages/32_Diamond/MiniScript/README.md
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
Original source downloaded from [Vintage Basic](http://www.vintage-basic.net/games.html).
|
||||||
|
|
||||||
|
Conversion to [MiniScript](https://miniscript.org).
|
||||||
23
00_Alternate_Languages/32_Diamond/MiniScript/diamond.ms
Normal file
23
00_Alternate_Languages/32_Diamond/MiniScript/diamond.ms
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
// Diamond
|
||||||
|
//
|
||||||
|
// Ported from BASIC to MiniScript by Joe Strout
|
||||||
|
|
||||||
|
print " "*33 + "DIAMOND"
|
||||||
|
print " "*15 + "CREATIVE COMPUTING MORRISTOWN, NEW JERSEY"
|
||||||
|
print; print; print
|
||||||
|
print "For a pretty diamond pattern,"
|
||||||
|
maxw = input("type in an odd number between 5 and 21: ").val
|
||||||
|
s = "CC" + "!" * maxw
|
||||||
|
columns = floor(68/maxw)
|
||||||
|
for row in range(1, columns)
|
||||||
|
for w in range(1, maxw, 2) + range(maxw-2, 1, -2)
|
||||||
|
print " "*(maxw-w)/2, ""
|
||||||
|
for column in range(1, columns)
|
||||||
|
print s[:w], ""
|
||||||
|
if column < columns then print " "*(maxw-w), ""
|
||||||
|
end for
|
||||||
|
print
|
||||||
|
wait 0.01
|
||||||
|
end for
|
||||||
|
end for
|
||||||
|
|
||||||
Reference in New Issue
Block a user