id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

zbaharav@kehillah.org 30-nestedloops > blocksToWall
prev  |  next  |  chance

A Block is composed of two enclosing X symbols, and - in between. The length of the Block denotes the number of - symbols. Thus, a block of length 3 is "X---X", and a Block of length 1 is "X-X". Write a function that accepts the number of blocks and their length as integers, and return a string representing them.


blocksToWall(1, 3) → "X---X"
blocksToWall(2, 1) → "X-XX-X"
blocksToWall(3, 0) → "XXXXXX"

...Save, Compile, Run (ctrl-enter)

public String blocksToWall(int blocks, int dashes) { }

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Java Help

Misc Code Practice

Difficulty: 100

Copyright Nick Parlante 2017 - privacy