CalmoSoft 0 Share Posted January 26, 2016 Sziasztok, Érdemes megnézni, kipróbálni a következőt: Ring Programming Language Üdv, Gál Zsolt (~ CalmoSoft ~) Link to comment Share on other sites More sharing options...
CalmoSoft 0 Author Share Posted January 29, 2016 Sziasztok, Ime a klasszkus 15-ös Kirakós Játék Üdv, Gál Zsolt (~ CalmoSoft ~) load "guilib.ring" load "gamelib.ring" load "ring_qt.ring" App1 = new qApp { rnd = [] empty = 16 win1 = new qWidget() { move(0,0) resize(350,400) setWindowTitle("CalmoSoft Fifteen Puzzle Game") new qPushButton(win1) { setgeometry(100,220,120,30) settext("Scramble") setclickevent("scramble()") } btn1 = new qPushButton(win1) { setgeometry(100,100,30,30) setclickevent("moveTile(1)") } btn2 = new qPushButton(win1) { setgeometry(130,100,30,30) setclickevent("moveTile(2)") } btn3 = new qPushButton(win1) { setgeometry(160,100,30,30) setclickevent("moveTile(3)") } btn4 = new qPushButton(win1) { setgeometry(190,100,30,30) setclickevent("moveTile(4)") } btn5 = new qPushButton(win1) { setgeometry(100,130,30,30) setclickevent("moveTile(5)") } btn6 = new qPushButton(win1) { setgeometry(130,130,30,30) setclickevent("moveTile(6)") } btn7 = new qPushButton(win1) { setgeometry(160,130,30,30) setclickevent("moveTile(7)") } btn8 = new qPushButton(win1) { setgeometry(190,130,30,30) setclickevent("moveTile(") } btn9 = new qPushButton(win1) { setgeometry(100,160,30,30) setclickevent("moveTile(9)") } btn10 = new qPushButton(win1) { setgeometry(130,160,30,30) setclickevent("moveTile(10)") } btn11 = new qPushButton(win1) { setgeometry(160,160,30,30) setclickevent("moveTile(11)") } btn12 = new qPushButton(win1) { setgeometry(190,160,30,30) setclickevent("moveTile(12)") } btn13 = new qPushButton(win1) { setgeometry(100,190,30,30) setclickevent("moveTile(13)") } btn14 = new qPushButton(win1) { setgeometry(130,190,30,30) setclickevent("moveTile(14)") } btn15 = new qPushButton(win1) { setgeometry(160,190,30,30) setclickevent("moveTile(15)") } btn16 = new qPushButton(win1) { setgeometry(190,190,30,30) settext("") setclickevent("moveTile(16)") } resetbtn = new qPushButton(win1) { setgeometry(100,250,120,30) settext("Reset") setclickevent("resetTiles()") } //button = [btn1, btn2, btn3, btn4, btn5, btn6, btn7, btn8, btn9, btn10, btn11, btn12, btn13, btn14, btn15, btn16] for i = 1 to 15 button[i] {settext(string(i))} next show() } exec() } func scramble for n= 1 to 300 nr=random(16) up = (empty = (nr - 4)) down = (empty = (nr + 4)) left = ((empty = (nr - 1)) and ((nr % 4) != 1)) right = ((empty = (nr + 1)) and ((nr % 4) != 0)) move = up or down or left or right if move = 1 and (nr != 0) button[nr] { temp = text() } button[empty] {settext(temp)} button[nr] {settext("")} empty = nr ok next func moveTile nr2 up = (empty = (nr2 - 4)) down = (empty = (nr2 + 4)) left = ((empty = (nr2- 1)) and ((nr2 % 4) != 1)) right = ((empty = (nr2 + 1)) and ((nr2 % 4) != 0)) move = up or down or left or right if move = 1 and (nr2 != 0) button[nr2] { temp2 = text() } button[empty] {settext(temp2)} button[nr2] {settext("")} empty = nr2 ok func resetTiles empty = 16 for i = 1 to 15 button[i] {settext(string(i))} next button[16] {settext("")} Link to comment Share on other sites More sharing options...
payskin 946 Share Posted January 29, 2016 Zsolt, szerintem el vagy tévedve. Egyrészt ez itt a Szoftver témacsoport, a programozás eggyel arrébb van, a szomszédban, de ez még a kisebb baj. A nagyobb, hogy a fórumot naponta megnézi pár száz ember, ebből jó, ha egy tucat regisztrált, és ha születik 3-4 hozzászólás (amit nem én írok), az már egy csodálatos termékeny nap volt. Szerintem erős 0 esély van arra, hogy a programnyelvedhez pont itt találj új rajongókra. Nem akarom elvenni a kedved, sőt, sok szerencsét hozzá, csak, gondoltam, szólok. Link to comment Share on other sites More sharing options...
CalmoSoft 0 Author Share Posted January 30, 2016 Szia Balázs, Igazad van. Hogyan tudom törölni a topicot? Üdv, Gál Zsolt (~ CalmoSoft ~) Link to comment Share on other sites More sharing options...
payskin 946 Share Posted January 30, 2016 Nem kell törölni, jól elvan ez itt. Még az is lehet, hogy hoz majd a jövőben 1-2 érdeklődőt. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now