む!
折角のデータなので
//----------------------------------------------------------------------------
// 善意検証プログラム
//
// 善意の日本地図データを「j.csv」というファイル名で保存
// 善意の日本地図データを読み込み、描画する
//
// 善意の度合いについては描画された日本地図で各々感じ取る事!
//----------------------------------------------------------------------------
gosub *dataload
gosub *view
/*
pos 0,0
for i,0,group + 1
mes "" + i + ":" + ( gpoint( i ) ) + "," + ( gend( i ) )
next
mes ""
gno = 0
for i,0,index
if gpoint( gno ) = i { mes ( gpoint( gno ) ) : g++ }
mes "" + int(point( i , 0 )) + "," + int(point( i,1 ))
next
*/
stop
//----------------------------------------------------------------------------
// 描画
//----------------------------------------------------------------------------
*view
offsetx = 320.0
offsety = 240.0
scale = 1.0
gno = 0
for i,0,index
sx = offsetx + point( i , 0 )
sy = offsety - point( i , 1 )
ex = offsetx + point( i + 1 , 0 )
ey = offsety - point( i + 1 , 1 )
if gend( gno ) = i {
ex = offsetx + point( gpoint( gno ) , 0 )
ey = offsety - point( gpoint( gno ) , 1 )
gno++
}
line sx , sy , ex , ey
next
return
//----------------------------------------------------------------------------
// データ取り込み
//----------------------------------------------------------------------------
*dataload
exist "j.csv" : size = strsize
if size < 0 : end
sdim data , size
notesel data
noteload "j.csv"
noteget lbuf : notedel 0
group = int( lbuf )
dim gpoint , group + 1
dim gend , group + 1
ddim point , (noteinfo(0) - groupe - 1) , 2
gindex = 0
index = 0
while ( data != "" )
gpoint( gindex ) = index
noteget lbuf : notedel 0
elm = int( lbuf )
for i,0,elm
noteget lbuf : notedel 0
split lbuf , "," , strx , stry
point( index , 0 ) = double( strx )
point( index , 1 ) = double( stry )
index++
next
gindex++
wend
gpoint( gindex ) = index
for i,0,group
gend( i ) = gpoint( i+1 ) -1
next
return