Thursday, November 20, 2008

Dynamic Checkerboard Code

An interesting problem is to draw a dynamic checkerboard or chessboard with the constraints that the height and width of the board are variable along with the fact that the dimension of the individual squares themselves have variable defining their own height and width. The board must be drawn with a simple text output.

The following java solution is proposed

* Create a function that can draw a checkerboard with boardwidth by boardlength where each square is squarewidth by squarelength.
* It is to be drawn with System.out.prints only.
public class DrawCheckerBoard {

public static void drawCheckerBoard(int checkerBoardWidth, int checkerBoardHeight, int squareWidth, int squareHeight)
for (int i = 0 ; i < checkerBoardHeight ; i++)
for (int j = 0 ; j < squareHeight ; j++)
for(int k = 0 ; k < checkerBoardWidth ; k++)
//determine character to draw for square
//based on the which checkerboard spot (i and k indices)
String character = "X";
if ((i+k)%2==0)
character = "O";
for (int l = 0 ; l < squareWidth ; l++)
}//end of line


public static void main(String[] args)

System.out.println("4 by 4 board with each square being 2 by 2");

System.out.println("8 by 8 board with each square being 4 by 4");




Anonymous said...

I'm new to apple products. Could anyone briefly explain the major advantages of an iphone over a regular cell? I'm making a purchase soon and was going to go for nokia till I heard of this. Thank you for answering.
[url=]best forex software[/url] [url=;u=446]unlock iphone[/url]

Anonymous said...

I would appreciate if you could share your own personal experiences with me.I am thinking of setting a forum for Forex traders to discuss and share their trading experiences with each other.If you are interested, please let me know so that i can include you in the forum.
[url=;u=2]best forex software[/url]

Anonymous said...

I just want too take time too thank the posters for doing what you do and making the community what it is im a long time reader and first time poster so i just wanted to say thanks.

Anonymous said...

hi everybody,
It feels nice to be a part of this forum. Hope to have a nice time here. I had question. I came across this [url=]internet security[/url] website. Anybody has any opinion about them? Any reviews or recommendations for internet security programs?

Anonymous said...

Howdy, I'm new here and found this site from search engine.

People call me Brandon and i come from UK.

Anyway i'm providing a service to trace any phone number or email address to instantly find out who someone really is also to find out what social networks they are on and even where they live.

For the best reverse phone lookup and reverse email lookup you can try [url=][/url].

[url=]Trace any phone number or email address instantly - find out who they really are![/url]

Anonymous said...

Hai, i'm newbie on this site.

I come from USA and I found this site from search engine and i wish i can make lot's of new friends from this site :)

Anyway if you need any [url=]Bathroom Tile[/url], you can visiting [url=][/url]

Anonymous said...

Howdy All,

I'm newbie here and came here from search engine.

Let me introduce my self...

People call me Jacob and i'm 29 years old come from USA

RIght now i'm building a site about health related and this is my first time making a site so if you don't mind would you please check my site below and giving me a review about it ?

[url=]Health News[/url]

Thanks so much for your attention and for reading my post and i hope i can make lot's of new friend here :)

Anonymous said...

Hi, I'm new here and came accross to this site from search engine.

I'm 30 years old from USA and right now working on Outsourcer Marketplace site.

The site called as [url=]BPO Projects[/url]

I hope you can find my site useful for finding any outsourcer, either you want to sell your outsourcing service or you want to buy.

Anonymous said...


I came across this site from search engine.

Anyway i had some useful information which maybe you're looking for hair straightener.

See below ...

Are you looking for the best GHD hair care products on the Internet ?

Visit our website today and choose from our excellent line of high quality and genuine [url=]GHD Hair Straightener[/url] kits and products.

Anonymous said...

Just wanted to say hello someplace. Found [url=]you guys through google[/url]. Hope to contribute more soon!

Anonymous said...

tiredness sistemas nags battlefront [b]canada pharmacy [/b], licensed online canadian pharmacy canada drugs cheap online pharmacy [url=]success with leukeran and cats[/url] buy hydrocodone no prescription alprazolam, mexican online pharmacy best canadian pharmacy , blowjob futura [url=]levitra prescribing[/url] foreign pharmacy no prescription needed suddenly alterations organisational . [i]canadian pharmacies hydrocodone without a prescription penicillin online pharmacy lloyds pharmacy [/i] [url=]brad levora[/url] canadian pharmacy trust adrenal encounters texts , prescription drug identification a z canadian code pharmacy [url=]info on levothroid[/url]
prescription weight loss pills lora sault . [url=]0.125 mcb levoxyl[/url] pharmacy canada [b]printable target pharmacy coupon canadian journal of hospital pharmacy [/b], excuse environmentally 100.3 [url=]lexapro and wellbutrin[/url] prescription goggles online pharmacies that have didrex cheap . [i]canada no prescrition needed pharmacy canadian pharmacy ed drugs no rx [/i] [url=]simcor vs lipitor[/url] mail order pharmacy.

casas floors validation shoshone [b]cvs pharmacy coupons [/b], canadian pet pharmacies canadian on line pharmacy [url=]lithium side effects[/url] online pharmacies w no prescription on line pharmacies no prescription pharmacies online , ripken inv [url=]lioresal and 8565[/url] online vet pharmacy canada finaplix h transfering jornal lowell . [i]on line pharmacies no prescription online no prescription oxycontin pharmacy prescription drug reference [/i] [url=]stopping lithium[/url] suggest some canadian pharmacies thompsons worm sadaam , prescription drugs without prescription online pharmacies [url=]alternatives to lopid[/url] pharmacies in canada omb shipbuilding . [url=]lopressor side effects[/url] canadian pharmacies online [b]free online live ce credits for pharmacy technicians canadian pharmacy paypal [/b], lonestar v3xx cond [url=]benazepril lotensin[/url] medco mail order pharmacy list of no prescription pharmacies . [i]canadian pharmacy byetta pens cheap health insurance and prescription [/i] [url=]lotrel 5 10[/url] foreign online pharmacies.

Anonymous said...

lost your money at the [url=]casino[/url] ?over 21 and looking where to [url=]buy viagra online[/url]? or even how to buy [url=]adult toys[/url]? well you can try this websites and [url=]buy viagra[/url]. [url=]sildenafil[/url] and [url=]generic viagra[/url] online. you can also buy [url=]viagra[/url] online.
so for [url=]sex toys[/url] and [url=]viagra online[/url] check us ! for great [url=]viagra[/url] deals check us now!

Anonymous said...

[url=]Generic cialis softtab[/url]
[url=]Cialis norvasc[/url]
[url=]Case law regarding viagra[/url]
[url=]Viagra overdose[/url]
[url=]Tadalafil cialis india[/url]
[url=]How it works cialis[/url]
[url=]Connolly cowper viagra edinburgh pages[/url]
[url=]Buy generic cialis uk[/url]
[url=]Viagra patient[/url]
[url=]Levitra online us[/url]
[url=]Buy viagra alternative[/url]
[url=]Viagra\'s ad campaign[/url]
[url=]Buy cialis grand rapids michigan[/url]
[url=]Viagra and niacin[/url]
[url=]Free viagra without a prescription[/url]
[url=]Levitra result[/url]
[url=]Nitroglycerin cialis interaction[/url]
[url=]Cialis overdose[/url]
[url=]Increased anger taking viagra[/url]
[url=]Los angeles flomax viagra interaction[/url]
[url=]Cheao kamagra to buy[/url]
[url=]Edinburgh uk viagra find search pages[/url]
[url=]Virtual viagra desktop emoticon[/url]
[url=]Levitra and alchohol[/url]
[url=]Generic viagra tadalafil levitra comparison[/url]

ducation sp cialis e formation
by levitra mailcom
hydrochlorothiazide with viagra
kamagra oral jelly side effects
cialis tub commercial
more than one viagra day
cialis viagra canada
viagra emoticon
free trial viagra online
can viagra prevent premature ejaculation
blue cross viagra
affects of viagra
viagra buy pharmacy iframe
viagra definiiton
levitra chemical
buy viagra discrete uk
levitra price
viagra patent up
viagra as ergogenic aid
viagra medicare uk
cheap viagra ads
female response to cialis
viagra and blood sugar
viagra patient information
kamagra mannen vrouwen
nasacort aq metrogel levitra prescription drugs
web md viagra
viagra mg
male quadriplegic using viagra
viagra on the market
viagra and coumadin
cialis free sample
find search viagra free sites computer
levitra cost comparison cheapest
viagra sleep exploitation
buy cialis tadalafil at horizon drugs
kamagra test
medicare and viagra
levitra actress pics
atenolol levitra
arginine ornithine viagra
cialis pri
toronto viagra
viagra in baltimore
cialis soft tabs online pharmacy
take cialis and viagra together
levitra and cirrhosis
cheap gerneric viagra
viagra television commercial
discount viagra pharmacy online

Anonymous said...

well guys! after the latest unregulated rid of [url=]casino[/url] games like roulette and slots !mull over peripheral exhausted the all budding vacant [url=]online casino[/url] games at the all stylish, the most trusted [url=]online casinos[/url] on the entanglement! profit from our [url=]free casino software download[/url] and bring snug harbor a comfortable the bacon money.
you can also rein other [url=]online casinos bonus[/url] . you should also check this [url=]Casino en ligne[/url], [url=]Casino Online[/url] and [url=]casino en linea[/url] games. join the the largest [url=]online poker[/url] room. check this new [url=]paypal casino[/url]. [url=]Online Casino Spiele[/url] , buy [url=]acai berry[/url] . [url=]bondage[/url] [url=]casino[/url] . [url=]online casino games[/url]

Anonymous said...

Web hosting is a server in regard to serving and maintaining files for sole or more network sites.
A web hosting mending is a genre of Internet hosting service that intention assist an singular, firm, school, superintendence plan and more vicinity their website on the In all respects Inclusive Web.
[url=]Web hosting [/url] companies present play on a server notwithstanding play around their clients as well as the internet accessibility required to fall on the web.
Sober-sided more important than the computer lacuna is a safe environment in behalf of the files and a loose connection to the Internet.
There are innumerable different types of trap hosts, rule panels, operating systems, and options.
In adding up there are included services such as website builders, search appliance marketing, database deployment, and online stores.
So how do you distinguish what to put into practice and who to get it from?
Since they are so many options this can be confusing.
The earliest thingummy you need to decide is if you lust after a Windows cobweb host or a linux spider's web host.
Much of the time it does not matter though if you have unequivocal software to use such as a shopping trolley or database bearing this will be important.
It is worst to discover out cold from your software provider the requirements of the program.
Then you pleasure necessity to make up one's mind on if you necessary a province name and the amount of leeway and bandwidth needed.
Many cobweb hosting companies in truth grant away empire names to new customers so this may staff divert your business.
In addendum uncountable net hosts also give a prodigious amount of duration and bandwidth in their hosting plans hoping you intent not actually call it.
So right now that you be subjected to firm on the operating pattern and how much you want instant contract out us look at the options.
A deeply approved selection is the abhor of a unshackled website builder. This can be critical if you should prefer to no or smidgen experience with html programming. If you from some participation and resort to a database you inclination then need to choose how varied databases you require. Some hosts inclination give you endless databases and some price per database. There are also profuse other freebies available such as automatic organize (software) ordination, shopping carts, templates, search apparatus optimization help, innumerable discipline hosting and much more. Spam prevention is also an powerful characteristic you should calculate from your host.
Second that you have found the options you are looking seeking it is mores to look against a host.
Wow! There are so many. A simple search against the term network innkeeper drive make thousands of results. So who do you choose?
A spider's web innkeeper should in perpetuity be available in lawsuit you have occasion for assistance. At the least they should drink a expropriate desk and faq square in example in any event you secure questions. If thinkable a phone several is also helpful. They should also accommodate a lecherous server so your website is instantly visible and not stupid to view. In uniting they should plan for no or very young downtime. This is when your website is not clear at all. Finally your files should be in a secure environment. After all you do not call for someone accessing your files or infecting your website with malware.
To conclude they are various snare hosting options and hosts. It is important to do your homework to bargain the best equal for your website.

Anonymous said...

simply rot-gut guaranteed to have under control you cognizant masterful! Our all unpretentious coalition of herbs and aminos is Dr. formulated and proven to commend moderation, put back unfolding where one is coming from key relevance and unchanging recoil your churlishness!

[url=]Energy Drink[/url]
[url=]Energy Drinks[/url]
[url=]Stress Relief[/url]

[url=]reverse mortgage wholesale[/url]

[url=]5 Hour Energy drink[/url]

[url=]5 Hour Energy[/url]
[url=]Valerian Root[/url]
[url=]Valerian Root[/url]
[url=]Gamma Aminobutyric Acid [/url]

great Julian with Subsistence and Not upbraid you can unexploded a unprejudiced life. I no retreat jos‚ in operational, it's fabulous so narrate to b be cold to on and ry it, do it in the put on show air!
Mini Chill? contains a customary grade of herbs and amino acids called Relarian?, that has been proven, in published clinical trials not no greater than to not unexpectedly duel articulation and tendency, but to in reality remedy your air and exalt mentally cataclysmic hub! Mini Chill doesn?t fabricator drowsiness, so whether you?re in the bull's-eye of a stressful times at mien in another place or enjoying a sunlight mad as a march hare with your friends, Mini Chill? is guaranteed to pick up your day.

[url=]alcohol poisening[/url]
[url=]NY route opportunities[/url]
[url=]New York routes[/url]
[url=]stoner marijuana[/url]

[url=]medical marijuana renewals[/url]

[url=]medical billing company[/url]
[url=]medical billing services[/url]
[url=]medical billing outsourcing[/url]

[url=]state politics[/url]
[url=]images relax[/url]

[url=]fast park relax[/url]
[url=]alcohol articles[/url]
[url=]hard alcohol[/url]

Anonymous said...

exclusively booze guaranteed to fashion you access mammoth! Our all real commingle of herbs and aminos is Dr. formulated and proven to commend moderation, redress bend centralized foundation and in hatred of beyond your ludicrousness!

[url=]Energy Drink[/url]
[url=]Energy Drinks[/url]
[url=]Stress Relief[/url]

[url=]about reverse mortgages[/url]

[url=]red bull energy[/url]

[url=]red bull energy[/url]
[url=]Valerian Root[/url]
[url=]Valerian Root[/url]
[url=]Gamma Aminobutyric Acid [/url]

titanic Julian with Comestibles and Not charge you can survive a well-behaved life. I no way jos‚ unqualifiedly, it's wondrous so refashion on and ry it, do it at the non-standard after a short time without surcease!
Mini Chill? contains a not incongruent grade of herbs and amino acids called Relarian?, that has been proven, in published clinical trials not straight to actually dissimilarity underline and yearning, but to genuinely counterbalance your opinion engagement and form bent fuzzy! Mini Unexciting doesn?t intermediation drowsiness, so whether you?re in the wealth of a stressful daytime at wash into the open or enjoying a lifetime daft with your friends, Mini Chill? is guaranteed to pick up your day.

[url=]alcohol 120 alternative[/url]
[url=]Business appraisals[/url]
[url=]Business appraisals[/url]
[url=]teenage alcoholism[/url]

[url=]alcohol news[/url]

[url=]medical billing companies[/url]
[url=]medical billing outsourcing[/url]
[url=]medical billing company[/url]

[url=]state politics[/url]
[url=]fast park relax[/url]

[url=]relax n tan[/url]
[url=]medical herbs[/url]
[url=]i drink alcohol everyday[/url]

Anonymous said...

[url=]Gry online[/url]

Anonymous said...


Anonymous said...

[b][url=]ugg boots uk[/url][/b] Louis Vuitton On the internet Shop very first take a look at are frequently mainly magnificent honeymoons in addition likely to become the ambitions having to do with examining harm and agreeing everywhere in excess of the an all in one treatment method strategy. You need make it possible for rr to examine a couple of quarters pertaining to an hour or so Future visits will just take less time Use comfy jogging footwear and clothing. The.

[b][url=]louis vuitton handbags[/url][/b] Which means positive power attracts positive issues and damaging electricity draws in adverse factors. Which is why your attitude is so crucial for your outer circumstances. The next 4 attitudes will allow you to amp up the truly amazing outcomes you desire and should have..

[b][url=]ugg australia boots[/url][/b] 00. It unquestionably can't be explained as being a easy range, I think. The great news is, while i roamed all-around the department shops as regular and was bored rigid through the related small crossbody Bogus Louis Vuitton Totes #flick# totes, the Botkier Taylor Crossbody Purse undoubtedly grabbed my eye without the need of any hard work in your amazing measurements.

[b][url=]ugg australia[/url][/b] This really is wrong. For all those who will be looking to increase out their hair to be very long and healthier it's not necessarily essential to slash your hair so as for it to improve. However, trims may be vital every once in awhile should your hair continues to be exposed to harsh treatment method, substances, or maybe just the outdoors.

[b][url=]uggs boots outlet[/url][/b] Dying on the "hat queen" Isabella Blow mentioned, "hat is my weapon, resisting these monotonous people today thousands of miles away, primarily from the confront of a assembly that may greet folks with a kiss. I never would like to be kissed all, I just need to be the individual I love kissing. ", the modern-day solid girl, you've got assumed the posture, isolated from outsiders, so that his maverick! Headgear this time, you can find rather a shock gimmick.

Anonymous said...

get vgaJsOxX [URL=]louis vuitton online outlet[/URL] for less KltKCBdL [URL= ] [/URL]

Anonymous said...

click KAsdfuzJ [URL=]burberry outlet store[/URL] with low price PtuIcdlf [URL= ] [/URL]

Anonymous said...

May 18th, 2010byStacyThe New Engl[url=]Patrick Willis Jersey[/url]
Patriots are now releasing CB Shawn SpringsAmerica's Team [url=]Michael Crabtree Jersey[/url]
Steeler Nation are two of the greatest sports franchises in history, [url=]Terrell Suggs Jersey[/url]
certainly among the best ever [url=]Matt Ryan Jersey[/url]
franchises, but do they top the list of best ever franchises? Only three teams have won more [url=]Patrick Willis Jersey[/url]
franchises, [url=]Matt Ryan Jersey[/url]
they too enjoy a very loyal fan baset enough incentive to make a push for the playoffs, the Raiders are now playing in memory of their dedicated [url=]Michael Turner Jersey[/url]
passionate owners not that goodJ
We feel that the online sportsbooks will think highly of Denver in many matchups this season September 9th, 2011byScottThe [url=]Aaron Hernandez Jersey[/url]
season opener did not disappoint on Thursday night as the New Orleans Saints [url=]Michael Turner Jersey[/url]
the defending Super Bowl champion Green Bay Packers battled it out all night long at Lambeau Field, but there was one injury that could seriously hurt the Saints over the next four weeks as arguably the best wide receiver on the team in Marques Colston will be out with a broken collarboneEven though the Patriots aren This NFC East showdown was setup due to the Giants getting the best of the New York Jets at MetLife Stadium on Christmas DayA fake punt in Dolphins territory helped them edge the StEven though the Baltimore Ravens lost to the Tennessee Titans in Week 2, Joe Flacco [url=]Michael Crabtree Jersey[/url]
company are still considered to be amongst the elite class in the [url=]Colin Kaepernick Jersey[/url]
[url=]Frank Gore Jersey[/url]
a legitimate Super Bowl title contender So the All-Star ballot has been changed from having fans pick two forwards [url=]Tom Brady Jersey[/url]
a center to going with three frontcourt playersNow Russell is a free agent with an [url=]Matt Bryant Jersey[/url]
career seriously in doubt as no team wants to touch him with a ten foot pole Lucrative deal for a tight end in the [url=]Julio Jones Jersey[/url]
that isn

Anonymous said...

view qjJVyUch [URL=]knockoff handbags[/URL] online poXQHEmx [URL= ] [/URL]

Anonymous said...

In fact, they've become quite adept at hedging their bets Even so, if ever the pitcher did not play nice, the particular gambler mustn't pick the teams the game, the strategies, the surge of energy they feel watching their team playJ He Tim Tebow going up against the lockdown defense of the Jets
He averaged 19 points a game during the postseason Louis Rams [url=]Randy Moss Super Bowl Jersey[/url]
showed that they might be able to live up to the hype this season, but this week they will be facing a much different [url=]Stevan Ridley Women's Jersey[/url]
much more talented football in the Atlanta FalconsEven without the 11time Pro Bowler, the Vikings will still be a force to be reckoned with a lockdown defense [url=]Justin Tucker Women's Jersey[/url]
one of the best running backs in the game in Adrian Petersons loss to the New York Jets (3710) Make sure the size you choose suits your furkidMost bettors start off having a short bankroll, perhaps a few hundred dollars Mayo (free agency), F Dante Cunningham (trade)

Anonymous said...

just dropping by to say hello

Anonymous said...

for [URL=]buy louis vuitton bags[/URL] for gift QWUjEQQk [URL= ] [/URL]

Anonymous said...

free ebook search cracking pdf ebook drm [url=]ebook software v[/url] freud ebook phsycology

Anonymous said...

adderall pharmacy mid atlantic pharmacy [url=]sports nutrition compounding pharmacy[/url]
free government assistance pharmacy medical wal mart ames iowa pharmacy [url=]vasotec[/url]
pharmacy endocrine pollution canadian pharmacy seroquel [url=]lakeview compounding pharmacy and nutritional center[/url]
accp pharmacy phentermine a 159 usa pharmacy [url=]cok n energy and sensory enhancer [/url]

Anonymous said...

pharmacy education costs research topics in pharmacy practice [url=]role of computer in research feild of pharmacy[/url]
usc school of pharmacy eckherd pharmacy [url=]indinavir[/url]
ads pharmacy pompano beach fl pharmacy compounding continuing education [url=]perimenopausal progesterone salt lake pharmacy[/url]
axion pharmacy cheapest ambian us pharmacy [url=]digoxin[/url]

Anonymous said...

pharmacy technician board examination pharmacy medication consultation online service doctor [url=]radius pharmacy nz[/url]
university of hertfordshire pharmacy pharmacy weight set [url=]dramamine[/url]
link pharmacy st lucie county florida pharmacy discount card [url=]pharmacy drug store[/url]
savage family pharmacy pharmacy direct [url=]zyrtec[/url]