Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

arrays - Prolog print out 2 dimension table -


i have square start , finish points, places can't go. , program must find way reach finish:

ar_galima([], _, _):-!. ar_galima([prad|galas],kelias, x) :- not(prad == x), not(member(x, kelias)), ar_galima(galas, kelias, x).   gener(stac_m, stac_k, k(a,b), k(y,b)) :-  y + 1, y > 0, y =< stac_m, b =< stac_k. gener(stac_m, stac_k, k(a,b), k(y,b)) :-  y - 1, y > 0, y =< stac_m, b =< stac_k. gener(stac_m, stac_k, k(a,b), k(a,y)) :-  y b + 1, y > 0, y =< stac_k, =< stac_m. gener(stac_m, stac_k, k(a,b), k(a,y)) :-  y b - 1, y > 0, y =< stac_k, =< stac_m.  paieska(_, _,_,tikslas,tikslas,[], _):-!. paieska(stac_m, stac_k, draudziama, prad, tikslas, [k|kelias], kelias2) :-        gener(stac_m, stac_k, prad, k), ar_galima(draudziama, kelias2, k),        paieska(stac_m, stac_k, draudziama, k, tikslas, kelias, [k|kelias2]).  trasa(ilgis, aukstis, draudziama, k(x,y), tikslas, kelias) :-       paieska(ilgis,aukstis, draudziama, k(x,y), tikslas,kelias, []). 

i find routes finish , i'm stuck outputing route (a list) 2 dimension table in terminal (well, simple graphic show of route).

example of list output:x = [k(2, 1), k(3, 1), k(4, 1), k(4, 2), k(4, 3), k(4, 4)] ;

could suggesst me how should output 2 dimension table terminal?

edit:

x should printed:

 + + + *  + + + *  + + + *  + * * * 

print perdicate this:

printtable(n, m, x) :- ...

where n number of rows, m number of columns , x list of coordinates.

you can this:

print_table(h, w, l):-   succ(w, w1),   print_table(4, 1, h, w1, l).  print_table(1, w, _, w, _):- !. print_table(y, w, h, w, l):-   succ(ny, y),   nl,   !,   print_table(ny, 1, h, w, l). print_table(y, x, h, w, l):-   (member(k(x, y), l)->c='* ';c='+ '),   write(c),   succ(x, nx),   !,   print_table(y, nx, h, w, l). 

Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -