Java輸出豎排的經典古典文字 – JAVA編程語言程序開發技術文章

最近百度上流行寫豎排字,有個別小白更以此用來發貼罵人,於是寫個用來還擊~~~


1.package org.test;
2.


3.import java.util.Collections;
4.import java.util.HashMap;
5.import java.util.Map;
6.


7./** *//**
8. * Copyright 2008
9. *
10. * Licensed under the Apache License, Version 2.0 (the “License”); you may not
11. * use this file except in compliance with the License. You may obtain a copy of
12. * the License at
13. *
14. * http://www.apache.org/licenses/LICENSE-2.0
15. *
16. * Unless required by applicable law or agreed to in writing, software
17. * distributed under the License is distributed on an “AS IS” BASIS, WITHOUT
18. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
19. * License for the specific language governing permissions and limitations under
20. * the License.
21. *
22. * @project loonframework
23. * @author chenpeng
24. * @email:ceponline@yahoo.com.cn
25. * @version 0.1
26. */27.public class ClassicalityCharacter {
28.


29.    final private String _content;
30.


31.    final private int _style;
32.


33.    final private int _col;
34.


35.    final private int _row;
36.


37.    // 空白標志38.    final private static char _blank =  ;
39.


40.    // 半角字庫41.    final private static String _half = “/”>1234567890!@#$%^&*()abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_=+\|[];:”,<.>/?()【】《》“””;
42.


43.    // 全角字庫44.    final private static char[] _full = new char[] { 1, 2, 3, 4, 5,
45.            6, 7, 8, 9, 0, !, @, #, $, %, ︿, &, *,
46.            (, ), a, b, c, d, e, f, g, h, i, j, k,
47.            l, m, n, o, p, q, r, s, t, u, v, w, x,
48.            y, z, A, B, C, D, E, F, G, H, I, J, K,
49.            L, M, N, O, P, Q, R, S, T, U, V, W, X,
50.            Y, Z, -, _, =, +, \, |, 【, 】, ;, :, ,
51.            , ,, 〈, 。, 〉, /, ?, ︵, ︶, ︻, ︼, ︽, ︾,
52.            『, 』 };
53.


54.    // 樣式表55.    final static private char[][] _frameStyle = new char[][] {
56.            { ╔, ╗, ╚, ╝, ╤, ╧, ║, │, ═ },
57.            { ╔, ╗, ╚, ╝, ╤, ╧, ║, ┆, ═ },
58.            { ╔, ╗, ╚, ╝, ╤, ╧, ║, ↓, ═ },
59.            { ╔, ╗, ╚, ╝, ╤, ╧, ║, ↑, ═ },
60.            { ╔, ╗, ╚, ╝, ╤, ╧, ║, ⿲, ═ },
61.            { ╔, ╗, ╚, ╝, ╤, ╧, ║, ★, ═ },
62.            { ╔, ╗, ╚, ╝, ●, ●, ║, ┆, ○ },
63.            { ╔, ╗, ╚, ╝, ⊕, ◎, ║, ┆, ○ },
64.            { ┏, ┓, ┗, ┛, ┯, ┷, ┃, │, ━ },
65.            { ╃, ╄, ╁, ╆, ┬, ┴, ║, │, ─ },
66.            { ┏, ┓, ┗, ┛, ▽, △, ┃, ┆, ━ },
67.            { ┏, ┓, ┗, ┛, ≈, ≈, ┃, ┆, ≈ },
68.            { 卐, 卐, 卐, 卐, 卐, 卐, 卐, ┆, 卐 },
69.            { 水, 水, 水, 水, 水, 水, 水, ┆, 水},
70.            {囧, 囧, 囧, 囧, 囧, 囧, 囧, ┆, 囧},
71.            {  ,  ,  ,  ,  ,  ,  ,  ,   } };
72.


73.    // gb2312字庫(部分)74.    final private static char[] _gb2312 = ” 皚藹礙愛骯襖奧壩罷擺敗頒辦絆幫綁鎊謗剝飽寶報鮑輩貝鋇狽備憊繃筆畢斃幣痹閉邊編貶變辯辮標鱉別癟瀕濱賓擯餅並撥缽鉑駁補財采參蠶殘慚慘燦蒼艙倉滄廁側冊測層詫攙摻蟬饞讒纏鏟產闡顫場嘗長償腸廠暢鈔車徹塵陳襯撐稱懲誠騁遲馳恥齒熾沖寵疇躊籌綢櫥廚鋤雛礎儲觸處傳瘡闖創錘純綽辭詞賜聰蔥囪從叢湊躥竄錯達帶貸擔單鄲撣膽憚誕彈當擋黨蕩檔搗島禱導盜燈鄧敵滌遞締顛點墊電淀釣調諜疊釘頂錠訂丟東動棟凍犢獨讀賭鍍鍛斷緞兌隊對噸頓鈍奪墮鵝額訛惡餓兒爾餌貳發罰閥琺礬釩煩販飯訪紡飛誹廢費紛墳奮憤糞豐楓鋒風瘋馮縫諷鳳膚輻撫輔賦復負訃婦縛該鈣蓋趕稈贛岡剛鋼綱崗鎬擱鴿閣鉻個給龔宮鞏貢鉤溝構購夠蠱顧剮關觀館慣貫廣規歸龜閨軌詭櫃貴劊輥滾鍋國過駭韓漢號閡鶴賀橫恒轟鴻紅壺護滬戶嘩華畫劃話懷壞歡環還緩換喚瘓煥渙黃謊揮輝毀賄穢會燴匯諱誨繪葷渾獲貨禍擊機積饑跡譏雞績緝極輯級擠幾薊劑濟計記際繼紀夾莢頰賈鉀價駕殲監堅箋間艱緘繭檢堿鹼揀撿簡儉減薦檻鑒踐賤見鍵艦劍餞漸濺澗將漿蔣槳獎講醬膠澆驕嬌攪鉸矯僥腳餃繳絞轎較階節潔結誡屆緊錦僅謹進晉燼盡勁荊莖鯨驚經頸靜鏡徑痙競凈糾廄舊駒舉據鋸懼劇鵑絹覺決訣絕鈞軍駿開凱顆殼課墾懇摳庫褲塊儈寬礦曠況虧巋窺饋潰擴闊蠟臘萊來賴藍欄攔籃闌蘭瀾讕攬覽懶纜爛濫撈勞澇樂鐳壘類淚籬離裡鯉禮麗厲勵礫歷瀝隸倆聯蓮連鐮憐漣斂臉鏈戀煉練糧涼兩輛諒療遼鐐獵臨鄰鱗凜賃齡鈴靈嶺領餾劉龍聾嚨籠壟攏隴樓婁摟簍蘆盧顱廬爐擄鹵虜魯賂祿錄陸驢呂鋁侶屢縷慮濾綠巒攣孿灤亂掄輪倫侖淪綸論蘿羅邏鑼籮騾駱絡媽瑪碼螞馬罵嗎買麥賣邁脈瞞饅蠻滿謾貓錨鉚貿麼沒鎂門悶們錳夢瞇謎彌覓冪綿緬廟滅憫閩鳴銘謬謀畝吶鈉納難撓腦惱鬧餒內擬膩攆釀鳥聶嚙鑷鎳檸獰寧擰濘鈕紐膿濃農瘧諾歐鷗毆嘔漚盤龐拋賠噴鵬騙飄頻貧蘋憑評潑頗鋪譜棲淒臍齊騎豈啟氣棄訖牽鉛遷簽謙錢鉗潛淺譴塹槍嗆墻薔強搶鍬橋喬僑翹竅竊欽親寢輕氫傾頃請慶瓊窮趨區軀驅齲顴權勸卻鵲確讓饒擾繞熱韌認紉榮絨軟銳閏潤薩鰓賽叁傘喪騷掃澀殺剎紗篩刪閃陜贍繕傷賞燒紹賒攝懾設紳審嬸腎滲聲繩勝聖師獅濕詩時蝕實識駛勢適釋飾視試壽獸樞輸書贖屬術樹豎數帥雙誰稅順說碩爍絲飼松聳慫頌訟誦擻蘇訴肅雖隨綏歲孫損筍縮瑣鎖獺撻態攤貪癱灘壇譚談嘆湯燙濤絳討騰謄銻題體屜條貼鐵廳聽烴銅統頭禿圖團頹蛻脫鴕馱駝橢窪襪彎灣頑萬網韋違圍為濰維葦偉偽緯謂衛溫聞紋穩問撾蝸渦窩臥嗚鎢烏誣無蕪吳塢霧務誤錫犧襲習銑戲細蝦轄峽俠狹廈嚇鮮纖賢銜閑顯險現獻縣餡羨憲線廂鑲鄉詳響項蕭囂銷曉嘯蠍協挾攜脅諧寫瀉謝鋅釁興洶銹繡虛噓須許敘緒續軒懸選癬絢學勛詢尋馴訓訊遜壓鴉鴨啞亞訝閹煙鹽嚴顏閻艷厭硯彥諺驗鴦楊揚瘍陽養樣瑤搖堯遙窯謠藥爺頁業葉醫銥頤遺儀蟻藝億憶義詣議誼譯異繹蔭陰銀飲隱櫻嬰鷹應纓瑩螢營熒蠅贏穎喲擁癰踴詠優憂郵鈾猶誘於輿魚漁娛與嶼語獄譽預馭鴛淵轅園員圓緣遠願約躍鑰粵悅閱雲鄖勻隕運蘊醞暈韻雜災載攢暫贊贓臟鑿棗責擇則澤賊贈軋鍘閘柵詐齋債氈盞斬輾嶄棧占戰綻張漲帳賬脹趙蟄轍鍺這貞針偵診鎮陣掙睜猙爭幀鄭證織職執隻紙摯擲幟質滯鐘終種腫眾謅軸皺晝驟豬諸誅燭矚囑貯鑄駐專磚

發佈留言