2019-07-07 07:46:11 UNSELECTED

Unknown type code

Copy Copied! Full
elseif TARG_NUM < 21 then --角 hosei = 1 for i = 1, 4 do if i == 1 then hosei = 9 elseif i == 2 then hosei = -9 elseif i == 3 then hosei = 1 elseif i == 4 then hosei = -1 end for i2 = 1, 9 do if ((BORD_NUM + hosei * i2) <= #BOARD_NUM) and ((BORD_NUM + hosei * i2) > 0) then if i < 3 then BOARD_POSSIBLE[BORD_NUM + hosei * i2] = 1 if ANG_NUM[BOARD_NUM[BORD_NUM]] == ANG_NUM[BOARD_NUM[BORD_NUM + hosei * i2]] then BOARD_POSSIBLE[BORD_NUM + hosei * i2] = 0 break elseif BOARD_NUM[BORD_NUM + hosei * i2] > 0 then break end else if (math.floor((BORD_NUM - 1 + hosei * i2) / 9) == math.floor((BORD_NUM - 1) / 9)) then BOARD_POSSIBLE[BORD_NUM + hosei * i2] = 1 if ANG_NUM[BOARD_NUM[BORD_NUM]] == ANG_NUM[BOARD_NUM[BORD_NUM + hosei * i2]] then BOARD_POSSIBLE[BORD_NUM + hosei * i2] = 0 break elseif BOARD_NUM[BORD_NUM + hosei * i2] > 0 then break end end end end end end if URA_FLG[TARG_NUM] == 180 then for i = 1, 4 do if i == 1 then hosei = 10 for i2 = 1, 1 do if ((BORD_NUM + hosei * i2) <= #BOARD_NUM) and ((BORD_NUM + hosei * i2) > 0) and (((BORD_NUM - 1) % 9 + i2) < 9) then BOARD_POSSIBLE[BORD_NUM + hosei * i2] = 1 if ANG_NUM[BOARD_NUM[BORD_NUM]] == ANG_NUM[BOARD_NUM[BORD_NUM + hosei * i2]] then BOARD_POSSIBLE[BORD_NUM + hosei * i2] = 0 break elseif BOARD_NUM[BORD_NUM + hosei * i2] > 0 then break end end end elseif i == 2 then hosei = -10 for i2 = 1, 1 do if ((BORD_NUM + hosei * i2) <= #BOARD_NUM) and ((BORD_NUM + hosei * i2) > 0) and (((BORD_NUM - 1) % 9 - i2) >= 0) then BOARD_POSSIBLE[BORD_NUM + hosei * i2] = 1 if ANG_NUM[BOARD_NUM[BORD_NUM]] == ANG_NUM[BOARD_NUM[BORD_NUM + hosei * i2]] then BOARD_POSSIBLE[BORD_NUM + hosei * i2] = 0 break elseif BOARD_NUM[BORD_NUM + hosei * i2] > 0 then break end end end elseif i == 3 then hosei = 8 for i2 = 1, 1 do if ((BORD_NUM + hosei * i2) <= #BOARD_NUM) and ((BORD_NUM + hosei * i2) > 0) and (((BORD_NUM - 1) % 9 - i2) >= 0) then BOARD_POSSIBLE[BORD_NUM + hosei * i2] = 1 if ANG_NUM[BOARD_NUM[BORD_NUM]] == ANG_NUM[BOARD_NUM[BORD_NUM + hosei * i2]] then BOARD_POSSIBLE[BORD_NUM + hosei * i2] = 0 break elseif BOARD_NUM[BORD_NUM + hosei * i2] > 0 then break end end end elseif i == 4 then hosei = -8 for i2 = 1, 1 do if ((BORD_NUM + hosei * i2) <= #BOARD_NUM) and ((BORD_NUM + hosei * i2) > 0) and (((BORD_NUM - 1) % 9 + i2) < 9) then BOARD_POSSIBLE[BORD_NUM + hosei * i2] = 1 if ANG_NUM[BOARD_NUM[BORD_NUM]] == ANG_NUM[BOARD_NUM[BORD_NUM + hosei * i2]] then BOARD_POSSIBLE[BORD_NUM + hosei * i2] = 0 break elseif BOARD_NUM[BORD_NUM + hosei * i2] > 0 then break end end end end end end BOARD_POSSIBLE[BORD_NUM] = 1 elseif TARG_NUM < 23 then --香車 hosei = 1 for i = 1, 4 do if i == 1 then hosei = 10 for i2 = 1, 8 do if ((BORD_NUM + hosei * i2) <= #BOARD_NUM) and ((BORD_NUM + hosei * i2) > 0) and (((BORD_NUM - 1) % 9 + i2) < 9) then BOARD_POSSIBLE[BORD_NUM + hosei * i2] = 1 if ANG_NUM[BOARD_NUM[BORD_NUM]] == ANG_NUM[BOARD_NUM[BORD_NUM + hosei * i2]] then BOARD_POSSIBLE[BORD_NUM + hosei * i2] = 0 break elseif BOARD_NUM[BORD_NUM + hosei * i2] > 0 then break end end end elseif i == 2 then hosei = -10 for i2 = 1, 8 do if ((BORD_NUM + hosei * i2) <= #BOARD_NUM) and ((BORD_NUM + hosei * i2) > 0) and (((BORD_NUM - 1) % 9 - i2) >= 0) then BOARD_POSSIBLE[BORD_NUM + hosei * i2] = 1 if ANG_NUM[BOARD_NUM[BORD_NUM]] == ANG_NUM[BOARD_NUM[BORD_NUM + hosei * i2]] then BOARD_POSSIBLE[BORD_NUM + hosei * i2] = 0 break elseif BOARD_NUM[BORD_NUM + hosei * i2] > 0 then break end end end elseif i == 3 then hosei = 8 for i2 = 1, 8 do if ((BORD_NUM + hosei * i2) <= #BOARD_NUM) and ((BORD_NUM + hosei * i2) > 0) and (((BORD_NUM - 1) % 9 - i2) >= 0) then BOARD_POSSIBLE[BORD_NUM + hosei * i2] = 1 if ANG_NUM[BOARD_NUM[BORD_NUM]] == ANG_NUM[BOARD_NUM[BORD_NUM + hosei * i2]] then BOARD_POSSIBLE[BORD_NUM + hosei * i2] = 0 break elseif BOARD_NUM[BORD_NUM + hosei * i2] > 0 then break end end end elseif i == 4 then hosei = -8 for i2 = 1, 8 do if ((BORD_NUM + hosei * i2) <= #BOARD_NUM) and ((BORD_NUM + hosei * i2) > 0) and (((BORD_NUM - 1) % 9 + i2) < 9) then BOARD_POSSIBLE[BORD_NUM + hosei * i2] = 1 if ANG_NUM[BOARD_NUM[BORD_NUM]] == ANG_NUM[BOARD_NUM[BORD_NUM + hosei * i2]] then BOARD_POSSIBLE[BORD_NUM + hosei * i2] = 0 break elseif BOARD_NUM[BORD_NUM + hosei * i2] > 0 then break end end end end end if URA_FLG[TARG_NUM] == 180 then hosei = 1 for i = 1, 4 do if i == 1 then hosei = 9 elseif i == 2 then hosei = -9 elseif i == 3 then hosei = 1 elseif i == 4 then hosei = -1 end for i2 = 1, 1 do if ((BORD_NUM + hosei * i2) <= #BOARD_NUM) and ((BORD_NUM + hosei * i2) > 0) then if i < 3 then BOARD_POSSIBLE[BORD_NUM + hosei * i2] = 1 if ANG_NUM[BOARD_NUM[BORD_NUM]] == ANG_NUM[BOARD_NUM[BORD_NUM + hosei * i2]] then BOARD_POSSIBLE[BORD_NUM + hosei * i2] = 0 break elseif BOARD_NUM[BORD_NUM + hosei * i2] > 0 then break end else if (math.floor((BORD_NUM - 1 + hosei * i2) / 9) == math.floor((BORD_NUM - 1) / 9)) then BOARD_POSSIBLE[BORD_NUM + hosei * i2] = 1 if ANG_NUM[BOARD_NUM[BORD_NUM]] == ANG_NUM[BOARD_NUM[BORD_NUM + hosei * i2]] then BOARD_POSSIBLE[BORD_NUM + hosei * i2] = 0 break elseif BOARD_NUM[BORD_NUM + hosei * i2] > 0 then break end end end end end end end BOARD_POSSIBLE[BORD_NUM] = 1 elseif TARG_NUM < 27 then --桂馬 if URA_FLG[TARG_NUM] == 0 then if ANG_NUM[TARG_NUM] == 90 then hosei = 9 else hosei = -9 end for i2 = 1, 9 do if ((BORD_NUM + hosei * i2) <= #BOARD_NUM) and ((BORD_NUM + hosei * i2) > 0) then if ((BORD_NUM + hosei * i2) <= #BOARD_NUM) and ((BORD_NUM + hosei * i2) > 0) then BOARD_POSSIBLE[BORD_NUM + hosei * i2] = 1 if ANG_NUM[BOARD_NUM[BORD_NUM]] == ANG_NUM[BOARD_NUM[BORD_NUM + hosei * i2]] then BOARD_POSSIBLE[BORD_NUM + hosei * i2] = 0 break elseif BOARD_NUM[BORD_NUM + hosei * i2] > 0 then break end end end end else if ANG_NUM[TARG_NUM] == 90 then for i = 1, 4 do if i == 1 then hosei = 7 for i2 = 1, 3 do if ((BORD_NUM + hosei + i2) <= #BOARD_NUM) and ((BORD_NUM + hosei + i2) > 0) and (math.floor(1 + (BORD_NUM - 1) / 9) == math.floor((BORD_NUM - 1 + hosei + i2) / 9)) then BOARD_POSSIBLE[BORD_NUM + hosei + i2] = 1 if ANG_NUM[BOARD_NUM[BORD_NUM]] == ANG_NUM[BOARD_NUM[BORD_NUM + hosei + i2]] then BOARD_POSSIBLE[BORD_NUM + hosei + i2] = 0 end end end elseif i == 2 then hosei = -1 if ((BORD_NUM + hosei) <= #BOARD_NUM) and ((BORD_NUM + hosei) > 0) and (math.floor((BORD_NUM - 1) / 9) == math.floor((BORD_NUM - 1 + hosei) / 9)) then BOARD_POSSIBLE[BORD_NUM + hosei] = 1 if ANG_NUM[BOARD_NUM[BORD_NUM]] == ANG_NUM[BOARD_NUM[BORD_NUM + hosei]] then BOARD_POSSIBLE[BORD_NUM + hosei] = 0 end end elseif i == 3 then hosei = 1 if ((BORD_NUM + hosei) <= #BOARD_NUM) and ((BORD_NUM + hosei) > 0) and (math.floor((BORD_NUM - 1) / 9) == math.floor((BORD_NUM - 1 + hosei) / 9)) then BOARD_POSSIBLE[BORD_NUM + hosei] = 1 if ANG_NUM[BOARD_NUM[BORD_NUM]] == ANG_NUM[BOARD_NUM[BORD_NUM + hosei]] then BOARD_POSSIBLE[BORD_NUM + hosei] = 0 end end elseif i == 4 then hosei = -9 if ((BORD_NUM + hosei) <= #BOARD_NUM) and ((BORD_NUM + hosei) > 0) and (math.floor(-1 + (BORD_NUM - 1) / 9) == math.floor((BORD_NUM - 1 + hosei) / 9)) then BOARD_POSSIBLE[BORD_NUM + hosei] = 1 if ANG_NUM[BOARD_NUM[BORD_NUM]] == ANG_NUM[BOARD_NUM[BORD_NUM + hosei]] then BOARD_POSSIBLE[BORD_NUM + hosei] = 0 end end end end else for i = 1, 4 do if i == 1 then hosei = 7 for i2 = 1, 3 do if ((BORD_NUM - hosei - i2) <= #BOARD_NUM) and ((BORD_NUM - hosei - i2) > 0) and (math.floor(-1 + (BORD_NUM - 1) / 9) == math.floor((BORD_NUM - 1 - hosei - i2) / 9)) then BOARD_POSSIBLE[BORD_NUM - hosei - i2] = 1 if ANG_NUM[BOARD_NUM[BORD_NUM]] == ANG_NUM[BOARD_NUM[BORD_NUM - hosei - i2]] then BOARD_POSSIBLE[BORD_NUM - hosei - i2] = 0 end end end elseif i == 2 then hosei = -1 if ((BORD_NUM - hosei) <= #BOARD_NUM) and ((BORD_NUM - hosei) > 0) and (math.floor((BORD_NUM - 1) / 9) == math.floor((BORD_NUM - 1 - hosei) / 9)) then BOARD_POSSIBLE[BORD_NUM - hosei] = 1 if ANG_NUM[BOARD_NUM[BORD_NUM]] == ANG_NUM[BOARD_NUM[BORD_NUM - hosei]] then BOARD_POSSIBLE[BORD_NUM - hosei] = 0 end end elseif i == 3 then hosei = 1 if ((BORD_NUM - hosei) <= #BOARD_NUM) and ((BORD_NUM - hosei) > 0) and (math.floor((BORD_NUM - 1) / 9) == math.floor((BORD_NUM - 1 - hosei) / 9)) then BOARD_POSSIBLE[BORD_NUM - hosei] = 1 if ANG_NUM[BOARD_NUM[BORD_NUM]] == ANG_NUM[BOARD_NUM[BORD_NUM - hosei]] then BOARD_POSSIBLE[BORD_NUM - hosei] = 0 end end elseif i == 4 then hosei = -9 if ((BORD_NUM - hosei) <= #BOARD_NUM) and ((BORD_NUM - hosei) > 0) and (math.floor(1 + (BORD_NUM - 1) / 9) == math.floor((BORD_NUM - 1 - hosei) / 9)) then BOARD_POSSIBLE[BORD_NUM - hosei] = 1 if ANG_NUM[BOARD_NUM[BORD_NUM]] == ANG_NUM[BOARD_NUM[BORD_NUM - hosei]] then BOARD_POSSIBLE[BORD_NUM - hosei] = 0 end end end end end end BOARD_POSSIBLE[BORD_NUM] = 1 elseif TARG_NUM < 31 then --銀 if URA_FLG[TARG_NUM] == 0 then for i2 = 1, 9 do if ANG_NUM[TARG_NUM] == 90 then if i2 < 2 then hosei = 19 for i2 = 1, 1 do if ((BORD_NUM + hosei * i2) <= #BOARD_NUM) and ((BORD_NUM + hosei * i2) > 0) then if ((BORD_NUM + hosei * i2) <= #BOARD_NUM) and ((BORD_NUM + hosei * i2) > 0) and (((BORD_NUM - 1) % 9 + i2) < 9) then BOARD_POSSIBLE[BORD_NUM + hosei * i2] = 1 if ANG_NUM[BOARD_NUM[BORD_NUM]] == ANG_NUM[BOARD_NUM[BORD_NUM + hosei * i2]] then BOARD_POSSIBLE[BORD_NUM + hosei * i2] = 0 break elseif BOARD_NUM[BORD_NUM + hosei * i2] > 0 then break end end end end else hosei = 17 for i2 = 1, 1 do if ((BORD_NUM + hosei * i2) <= #BOARD_NUM) and ((BORD_NUM + hosei * i2) > 0) then if ((BORD_NUM + hosei * i2) <= #BOARD_NUM) and ((BORD_NUM + hosei * i2) > 0) and (((BORD_NUM - 1) % 9 - i2) >= 0) then BOARD_POSSIBLE[BORD_NUM + hosei * i2] = 1 if ANG_NUM[BOARD_NUM[BORD_NUM]] == ANG_NUM[BOARD_NUM[BORD_NUM + hosei * i2]] then BOARD_POSSIBLE[BORD_NUM + hosei * i2] = 0 break elseif BOARD_NUM[BORD_NUM + hosei * i2] > 0 then break end end end end end else if i2 < 2 then hosei = -19 for i2 = 1, 1 do if ((BORD_NUM + hosei * i2) <= #BOARD_NUM) and ((BORD_NUM + hosei * i2) > 0) then if ((BORD_NUM + hosei * i2) <= #BOARD_NUM) and ((BORD_NUM + hosei * i2) > 0) and (((BORD_NUM - 1) % 9 - i2) >= 0) then BOARD_POSSIBLE[BORD_NUM + hosei * i2] = 1 if ANG_NUM[BOARD_NUM[BORD_NUM]] == ANG_NUM[BOARD_NUM[BORD_NUM + hosei * i2]] then BOARD_POSSIBLE[BORD_NUM + hosei * i2] = 0 break elseif BOARD_NUM[BORD_NUM + hosei * i2] > 0 then break end end end end else hosei = -17 for i2 = 1, 1 do if ((BORD_NUM + hosei * i2) <= #BOARD_NUM) and ((BORD_NUM + hosei * i2) > 0) then if ((BORD_NUM + hosei * i2) <= #BOARD_NUM) and ((BORD_NUM + hosei * i2) > 0) and (((BORD_NUM - 1) % 9 + i2) < 9) then BOARD_POSSIBLE[BORD_NUM + hosei * i2] = 1 if ANG_NUM[BOARD_NUM[BORD_NUM]] == ANG_NUM[BOARD_NUM[BORD_NUM + hosei * i2]] then BOARD_POSSIBLE[BORD_NUM + hosei * i2] = 0 break elseif BOARD_NUM[BORD_NUM + hosei * i2] > 0 then break end end end end end end end else if ANG_NUM[TARG_NUM] == 90 then for i = 1, 4 do if i == 1 then hosei = 7 for i2 = 1, 3 do if ((BORD_NUM + hosei + i2) <= #BOARD_NUM) and ((BORD_NUM + hosei + i2) > 0) and (math.floor(1 + (BORD_NUM - 1) / 9) == math.floor((BORD_NUM - 1 + hosei + i2) / 9)) then BOARD_POSSIBLE[BORD_NUM + hosei + i2] = 1 if ANG_NUM[BOARD_NUM[BORD_NUM]] == ANG_NUM[BOARD_NUM[BORD_NUM + hosei + i2]] then BOARD_POSSIBLE[BORD_NUM + hosei + i2] = 0 end end end elseif i == 2 then hosei = -1 if ((BORD_NUM + hosei) <= #BOARD_NUM) and ((BORD_NUM + hosei) > 0) and (math.floor((BORD_NUM - 1) / 9) == math.floor((BORD_NUM - 1 + hosei) / 9)) then BOARD_POSSIBLE[BORD_NUM + hosei] = 1 if ANG_NUM[BOARD_NUM[BORD_NUM]] == ANG_NUM[BOARD_NUM[BORD_NUM + hosei]] then BOARD_POSSIBLE[BORD_NUM + hosei] = 0 end end elseif i == 3 then hosei = 1 if ((BORD_NUM + hosei) <= #BOARD_NUM) and ((BORD_NUM + hosei) > 0) and (math.floor((BORD_NUM - 1) / 9) == math.floor((BORD_NUM - 1 + hosei) / 9)) then BOARD_POSSIBLE[BORD_NUM + hosei] = 1 if ANG_NUM[BOARD_NUM[BORD_NUM]] == ANG_NUM[BOARD_NUM[BORD_NUM + hosei]] then BOARD_POSSIBLE[BORD_NUM + hosei] = 0 end end elseif i == 4 then hosei = -9 if ((BORD_NUM + hosei) <= #BOARD_NUM) and ((BORD_NUM + hosei) > 0) and (math.floor(-1 + (BORD_NUM - 1) / 9) == math.floor((BORD_NUM - 1 + hosei) / 9)) then BOARD_POSSIBLE[BORD_NUM + hosei] = 1 if ANG_NUM[BOARD_NUM[BORD_NUM]] == ANG_NUM[BOARD_NUM[BORD_NUM + hosei]] then BOARD_POSSIBLE[BORD_NUM + hosei] = 0 end end end end else for i = 1, 4 do if i == 1 then hosei = 7 for i2 = 1, 3 do if ((BORD_NUM - hosei - i2) <= #BOARD_NUM) and ((BORD_NUM - hosei - i2) > 0) and (math.floor(-1 + (BORD_NUM - 1) / 9) == math.floor((BORD_NUM - 1 - hosei - i2) / 9)) then BOARD_POSSIBLE[BORD_NUM - hosei - i2] = 1 if ANG_NUM[BOARD_NUM[BORD_NUM]] == ANG_NUM[BOARD_NUM[BORD_NUM - hosei - i2]] then BOARD_POSSIBLE[BORD_NUM - hosei - i2] = 0 end end end elseif i == 2 then hosei = -1 if ((BORD_NUM - hosei) <= #BOARD_NUM) and ((BORD_NUM - hosei) > 0) and (math.floor((BORD_NUM - 1) / 9) == math.floor((BORD_NUM - 1 - hosei) / 9)) then BOARD_POSSIBLE[BORD_NUM - hosei] = 1 if ANG_NUM[BOARD_NUM[BORD_NUM]] == ANG_NUM[BOARD_NUM[BORD_NUM - hosei]] then BOARD_POSSIBLE[BORD_NUM - hosei] = 0 end end
RECOMMEND
//指定したIDのGoogle Calendarから一週間分のイベント情報を取得してGoogle slidesの表に入力、それを画像としてGoogle Drive上の指定したIDの画像ファイルに出力するVRC Panorama用スクリプトです。 // //・使い方 //1. 下の指定するファイルについてを参考にファイルを作成し、updateImageFileIdにVRC Panorama参照用画像ファイルID、calendarIdにGoogleCalendarID、presentationIdスクリプトで編集されるスライドのIDを指定してください。 //2. 関数を選択からupdateCalendar()を選択、実行すると、表示→ログに参照用画像ファイルのURLが出力されるので、unity上のVRC Panoramaのpanoramasのurlに指定してください。 // またVRC Panorama参照用画像ファイルに、スクリプトで編集されるスライドのサムネイルが出力されるので確認してください //3. 編集→現在のプロジェクトのトリガーより、updateCalendar()を自動起動するタイミングを設定してください。 // //・指定するファイルについて //スクリプトで編集されるスライド(presentationIdに指定するスライド)にはGoogle Drive上にスライド内の1ページ目に7×2の表を作成し、すべてのセルに値を入れてあるものを指定してください。 //指定するスライド例(https://qiita-image-store.s3.amazonaws.com/0/176380/c0a6ed8a-4cca-bbc6-eee2-981b01d78346.png) //VRC Panorama参照用画像ファイルは適当な画像をGoodle Driveにアップロードし、他の人から観覧できるようにしたものを指定してください。 //メイン関数 function updateCalendar(){ var updateImageFileId = "";//VRC Panorama参照用画像ファイルID var calendarId = '';//GoogleCalendarID var presentationId = "";//スクリプトで編集
Unknown type code