text:
Randomized Pumpkin Patch
I was walking through a pumpkin patch the other day for a birthday party, and noticed the pumpkin vines making a nifty pattern, with whirls, loops, and offshoots. We're going to simulate that here with some ASCII art.
          (())
            \
   p--q      p-----q
  /    \    /       \
(())    b--d       (())

Vine Construction Rules

There is only one main vine, composed solely of \ / - p q b d characters.
The vine only travels from left to right across the screen. In other words, suppose you were an ant starting at the left-most vine character. As you progress to the next adjacent character on the main vine, you must move one column to the right - never to the left.
When the vine changes direction, one of the p q b d characters are required to simulate a loop. The p joins vines traveling northeast to east, the q for east to southeast, the b from southeast to east, and the d from east to northeast. Note that the "loop" of the letter connects to the horizontal vine, and the "stem" of the letter connects to the diagonal.
The beginning of the vine must be one of p or b (your choice, doesn't have to be random), and starts horizontally. The end of the vine must be one of q or d (your choice, doesn't have to be random), and must end horizontally.
Note that loops can be placed immediately adjacent to other loops (e.g., pd is a valid substring of the vine), but that may make it more difficult to place the pumpkins later. You may want to always have one of - / \ immediately after a loop (as I did in my examples), but it's not required.

Pumpkin Rules

The pumpkins are composed solely of (()) (this exact string).
From the main vine, the pumpkins are attached by offshoots. These offshoots can only be attached to the p q b d loops, are precisely one \ or / in length, and attach to the pumpkin so the "end" of the offshoot is in the middle.
They can connect above or below the main vine.
The offshoots can connect going to the "left."
Only one pumpkin can attach per offshoot, and only one offshoot per loop.

Randomness

When traveling horizontally, the vine has a 50% chance of continuing horizontally, a 25% chance of turning northeast, and a 25% chance of turning southeast.
When traveling diagonally, the vine has a 90% chance of turning horizontal and a 10% chance of continuing diagonally.
There must be sufficient turns to support the input number of pumpkins, though more turns are allowed.
Once the vine is constructed, pumpkins can be randomly placed at any corner not already occupied by a pumpkin.
Pumpkins cannot overlap the vine or other pumpkins.

The Challenge
Given an input number, output a randomized pumpkin patch following the above rules. Executing the code multiple times with the same input should yield different results. All possible pumpkin patches for a given input number should have some (not necessarily equal) non-zero chance of occurring.
Input
A single integer n representing the number of pumpkins in the patch, in any convenient format. For brevity of code, you can assume the input is 0 < n < 256.
Output
The resulting pumpkin patch, either printed/displayed to the screen or returned as a string/string-array/etc.
Rules

This is code-golf so all the usual rules for golfing apply, and the shortest code (in bytes) wins.
Use our standard definition of "Random."
Either a full program or function are acceptable.
Standard loopholes are forbidden.
Leading and trailing whitespace / newlines are all completely optional.

Examples
For input n = 3, here are some VALID examples of a pumpkin patch following the above rules (separated by blank newlines).
          (())
            \
   p--q      p-----q
  /    \    /       \
(())    b--d       (())

(()) (())
  \   /
   b-q (())
      \ /
       b-q

p-----------------------q (())
                       / \ /
                     (()) b-q
                           /
                         (())

Here are some INVALID examples for input n = 3, with explanations #.
    (()) (())
     /    /
p---q----q
 \
(())
# The vine continued horizontally after a loop was placed.

(()(())
  \ /
   p---q
        \
       (())
# The pumpkins are both overlapping and sprouting from the same loop.

p----------------q
 \      \         \
(())   (())      (())
# The pumpkin is attached to the middle of the vine, not at a loop.

And now design a 2D language using this as the syntax. :)

Python 2, 819 bytes
Takes n as input
Always places pumkpins on the 'outside' of corners (randomly left/right)
While the vine is constructed, pumpkins are added, and when enough pumpkins are there, the vine stops.
r=lambda:__import__('random').random()
s=1
v=[s]*4
U=[-9]
D=[-9]
i=input()
while len(U)+len(D)<i+2:s=[[0,1][r()<.9],[[0,2][r()<.5],1][r()<.5],[2,1][r()<.9]][s];exec['',[['','U+=[len(v)]'][U[-1]<len(v)-7],'',['','D+=[len(v)]'][D[-1]<len(v)-7]][v[-1]-s+1]][r()<.8];v+=[s]*[1,2][v[-1]!=s]
v+=[1]*5
m=M=s=0
for i in v:s+=i-1;m=[m,s][m>s];M=[M,s][M<s]
R=[[' ']*(M-m+5)for x in v]
m=-m+2
R[2][m]='p'
for x in range(3,len(v)-3):X=v[x-1];R[x][m]='/d p-b q\\'[v[x]*3+X];m+=v[x]-1
R[-3][m]='q'
M=[len(a)-len(a.lstrip())for a in map(''.join,R)]
R=map(list,zip(*R))
B,L,a='-/U'
K="\\"*4
W="""exec("for p in "+a+"[1:]:x=M[p];b=r()<.5;exec('R[x"+B+"1][p'+['+1]=\\""+L+"\\"','-1]=\\""+K+"\\"'][b]);i=p-[0,3][b];l='(';exec('R[x"+B+"2][i]=l;i+=1;'*2+'l=\\")\\";')*2")"""
exec W+";B,a='+D';L,K=K,L;"+W
for x in R:print''.join(map(str,x))

Examples:
n=4
                (())
                 /
                p---q
 (())          /
   \       p--d
  p-q     /    \
     \   /    (())
      b-d
       \
      (())

n=20
                            (())
                              \
                            p--q
                           /    \
                          /      b--q
           (())     p----d      /    \
  (())       \     /          (())    b-q (())
    \         p---d                      \  \
  p--q       /     \                      b--q
      \     /     (())                   /    \                        (())                                           (())
       b---d                           (())    b-q                       \                                             /
        \                                         \          (())         p-q                                         p---q
       (())                                        \           \         /   \                                       /
                                                    b-----------q     p-d     b-q                            (())p--d
                                                                 \   /       /   \                            / /    \
                                                                  b-d      (())   b-q   (())  (())   p-q     p-d    (())
                                                                   /                 \   /      \   /   \   /
                                                                 (())                 b-q        p-d     b-d
                                                                                \ \      /         \
                                                                                (())b----d         (())
                                                                                /
                                                                                (())

Congrats, you win by default! :D


text:
Division of not so little numbers
Write a program or function that takes in positive integers a, b and c, and prints or returns a/b to c decimal places, using the operations +-*/% [add, subtract, multiply, divide, modulate] on the positive integers: you can use all that your language allows, but not on floating point numbers. The range of a,b,c would be the range allowed for unsigned integers in your language.
The number result will be truncated to the last digit to print (so no round).
This means that if your language does not have an integer type (only float), you can participate by using these float numbers as positive integers only.
The clue of this exercise it would be to write the function that find the
digits in a float point division, using only the operation +-*/%  on
[unsigned] integers.
Examples

print(1,2,1) would print 0.5
print(1,2,2) would print 0.50
print(13,7,27) would print 1.857142857142857142857142857
print(2,3,1) would print 0.6
print(4,5,7) would print 0.8000000
print(4,5,1) would print 0.8
print(9999,23,1) would print 434.7
print(12345613,2321,89) would print if your Language has 32 bit unsigned 5319.09220163722533390779836277466609220163722533390779836277466609220163722533390779836277466

The shortest code in bytes wins. I'm sorry if this appear not clear... I don't know languages too, not remember words well...
It is better to have one link to Ideone.com or some other place for easily try the answer especially for to test some input different from proposed.

What is the range of the integers a,b,c ?

@Ton Hospel the range of a,b,c would be the range allow for unsigned integer in your Language: for example if it is a 32 bit unsigned it would be 0..0xFFFFFFFF but if c>=0xFFFFFFF so big the output would be a little slow...

It is a rounding function - or, more precisely, it needs to be a rounding function to be properly specified. At present, it's unclear what the correct answer would be for e.g. (1,2,0). See http://meta.codegolf.stackexchange.com/a/5608/194

Sorry for reopening this question; I think it's almost ready to be reopened, except for the problem Peter Taylor pointed out. What is the output fo (1,2,0)?

Actually (1,2,0) should be irrelevant since 0 is not a positive integer. And I'd prefer it if c remains like that since I'd prefer not having to think about appending a . or not

If c is always positive, you could change your (1,2,0) example to (2,3,1) (0.6 without rounding, 0.7 with).

(2,3,0) is still a useless example if we don't need to handle the non-positive case c=0. Try (2,3,1) instead, please.

What would (4,5,2) output? 0.8 or 0.80

@BradGilbertb2gills would print "0.80"... this is a convension... it is so  because here the clue is the function that find the digits in a division....

I'm a bit confused about what you mean with "using the operations +-*/% [add, subtract, multiply, divide, modulate] on the positive integers:". As far as I understand, you will have a divided by b which is a decimal number, and you round that to c amount of decimal points behind the comma. So why would I need anything else besides / as mathematical operand?

@KevinCruijssen if a and b are not negative integers, b!=0, than a/b as unsigned integer is not a decimal number is a not negative integer... 1/3 is not, see as integer 0.3333333[float] but it is 0[not negative integer].  7/3=2 [as not negative integer ] ecc

@RosLuP So you basically mean that you should take a/b with c decimal points, without rounding. So 1/6 becomes 1.166666... and the output with four decimal points will be 1.1666 (not rounded) instead of 1.1667. So someone could just use floor/down-rounding for the correct results.

@KevinCruijssen: yes, but you are only allowed to use integer math. No floating point division, for example.

@nimi Well, floating points only have a 'precision' of 17 decimal points if I'm not mistaken, and after that ever decimal point digit becomes 0, so third and last test cases wouldn't even be possible to output with mere floating points.

Is it allowed to use / for numerical data types that provide Rational or Floating point functionality but only use integer for the implementation? See also the discussion in the comments of this answer.

@nimi If you use float Point as integer: is ok. For example 1.000000 / 2.000000 has to be "0.000000" as in the C language code unsigned a=1, b=2; a/b is 0; not 0.5.

@RosLuP: ... and other numerical data types like Rationals or Fixed-point? Did I get it right, they are only fine as long as the result of / is immediately turned into an integer (in the mathematical sense)?

@nimi yes an integer that is truncated; as the "/" for unsigned integer type in the C Language example  8/3=2  not 8/3=2.6666666666666666666666666666667 so no round to the digit afther the point

05AB1E, 17 13 11 19 14 bytes
Input in the form b, a, c.
Saved 5 bytes thanks to Grimy.
‰`¹+I°*¹÷¦'.sJ

Try it online!

I just tried it online with input 13,7,27 and answer is not correct

@shigazaru: It returns the same result as the test-cases. Did you notice the order of inputs is b,a,c?

I try the button "Try online" where there is this division:12345613/2321 with 89 digits, but the result there is something as 5319.922... instead of 5319.0922...

@RosLuP: That was an expensive fix :( I'll have to look into golfing this down at another time.

@RosLuP: The accepted answer has the same issue, try 2/21 to 10 decimals for example.

Yes in 2/21 10 digits it print to me 9 digit after the point

15: ‰`I°*¹÷I°+¦'.sJ

14: ‰`¹+I°*¹÷¦'.sJ

@Grimy:Thank you! I really should take the time to revisit some of my old answers. I should be able to golf quite a few of them, even without using new functionality (not that we still have a rule against that).

Haskell, 87 bytes
(a#b)c|s<-show$div(a*10^c)b,l<-length s-c,(h,t)<-splitAt l s=['0'|l<1]++h++['.'|c>0]++t

Usage example: (13#7)27 -> "1.857142857142857142857142857".
23 bytes to handle the c==0 case and using a leading zero instead of things like .5.
How it works: multiply a with 10^c, divide by b, turn into a string, split where the . must be inserted, join both parts with a . in-between and fix the edge cases.

Perl 6,  58 57 55  48 bytes
{(($^a.FatRat/$^b*10**$^c).Int.FatRat/10**$c).base(10,$c)}

{(Int($^a.FatRat/$^b*10**$^c).FatRat/10**$c).base(10,$c)}

{base Int($^a.FatRat/$^b*10**$^c).FatRat/10**$c: 10,$c}

{base ($^a*10**$^c div$^b).FatRat/10**$c: 10,$c}

What is fairly annoying is that it could be shortened to just {($^a.FatRat/$^b).base(10,$^c)} if it was allowed to round to the nearest value.
Explanation:
# bare block lambda with 3 placeholder parameters ｢$^a｣, ｢$^b｣ and ｢$^c｣
{
  (
    (

      # create an Int containing all of the digits we care about
      $^a * 10 ** $^c div $^b

    ).FatRat / 10**$c  # turn it into a Rational

  ).base( 10, $c )     # force it to display ｢$c｣ digits after the decimal point
}

I'm not familiar with perl6, but isn't (...).FatRat / 10**$x a division of a Rational? You're only allowed to divide integers.

@nimi a Rational is a class with two Ints.

The math operators are only allowed for integer types and not for other numerical types. Quote: "The clue of this exercise ... to write the function ... using only the operation +-*/% on [unsigned] integers."

@nimi So if I wrote a reimplementation of Rational, and didn't add a does Real or does Numeric it would be allowed? What if I augment (monkey patch) the existing class to remove those roles, would that be allowed?

Don't know. I read the spec as said before: +-*/% only with plain integer types. "plain integer" in terms of functionality (first of all: integer division) not of internal representation. Do you think it's allowed to use a software floating point library, which (despite the name) also uses only integers for  internal representation?

I've asked the OP to clarify.

If you use float Point as integer: is ok. For example 1.000000 / 2.000000 has to be "0" as in the C language code unsigned a=1, b=2; a/b is 0; not 0.5.

@RosLuP Rational is stored as two Int's (Numerator,Denominator), and that class/type is doing integer math internally. Is it ok that I'm using a built-in class that only pretends to be an unlimited precision float.

JavaScript (ES6), 55 50 bytes
f=(a,b,c,d=".")=>~c?(a/b|0)+d+f(a%b*10,b,c-1,""):d

(a/b|0) performs float division but immediately casts to an integer. Please let me know if this is not allowed.

PHP, 187 Bytes
works with strings for the numerator which can be int values greater then PHP_INT_MAX
list(,$n,$d,$c)=$argv;$a=str_split($n);while($a){$n.=array_shift($a);if($n>=$d||$r)$n-=$d*$r[]=$n/$d^0;}if(!$r)$r[]=0;if($c)$r[]=".";while($c--){$n*=10;$n-=$d*$r[]=$n/$d^0;}echo join($r);

I have no other chance then 13/7 is shorten to 1.8571428571429 and I reach so not the test case with 27 decimal places
This way 36 Bytes is not allowed
<?=bcdiv(($z=$argv)[1],$z[2],$z[3]);

float division is not allowed as per OP

@Maltysen Sorry I make a rollback.I was so afraid to find a shorter solution that I not recognize that it against the specifation.

Perl, 55 bytes
Includes +3 for -p
Give a and b on one line on STDIN, c on the next
division.pl
1 26
38
^D

division.pl:
#!/usr/bin/perl -p
eval'$\.=($_/$&|0)."."x!$\;$_=$_%$&.0;'x(/ .*/+<>)}{

the $_/$& is a bit arguable. I Actually want an integer division there but perl doesn't have that without loading special modules. So it's temporarily a non-integer which I then immediately truncate (using |0) so I end up with the integer an integer division would give. It could be rewritten as ($_-$_%$&)/$& in order to not even temporarily have a non-integer value (it would internally still be a float though)

Could you use $- to make it int only? (I think there are strict limits on the mix/max of it, and I'm sure you'd have already considered it, but though it worth checking!)

@DomHastings It would still be a truncate after doing a floating point division. Perl simply doesn't have integer division without use integer

Ah, so it's just masked with $-, good to know. Thanks!

Racket 203 bytes
(let*((s(~r(/ a b)#:precision c))(sl(string-split s "."))(s2(list-ref sl 1))(n(string-length s2)))
(if(< n c)(begin(for((i(- c n)))(set! s2(string-append s2 "0")))(string-append(list-ref sl 0)"."s2))s))

Ungolfed:
(define (f a b c)
  (let* ((s (~r(/ a b)#:precision c))
         (sl (string-split s "."))
         (s2 (list-ref sl 1))
         (n (string-length s2)))
    (if (< n c)
        (begin
          (for ((i (- c n)))
            (set! s2 (string-append s2 "0")))
          (string-append (list-ref sl 0) "." s2))
        s )))

Usage:
(f 7 5 3)
(f 1 2 1)
(f 1 2 2)
(f 13 7 27)

Output:
"1.400"
"0.5"
"0.50"
"1.857142857142857142857142857"

Other method (not valid answer here):
(real->decimal-string(/ a b)c)

I'm afraid this is invalid, because real->decimal-string expects a real value as its first argument, so / is floating point division, which is not allowed in this task. Also:  real->decimal-string rounds ((f 1 6 7) -> 0.1666667) instead of truncating.

Thanks for the observations. I will correct the code soon.

Java 7, 105 bytes
import java.math.*;String c(int...a){return new BigDecimal(a[0]).divide(new BigDecimal(a[1]),a[2],3)+"";}

Ungolfed & test code:
Try it here.
import java.math.*;
class M{
  static String c(int... a){
    return new BigDecimal(a[0]).divide(new BigDecimal(a[1]), a[2], 3)+"";
  }

  public static void main(String[] a){
    System.out.println(c(1, 2, 1));
    System.out.println(c(1, 2, 2));
    System.out.println(c(13, 7, 27));
    System.out.println(c(2, 3, 1));
    System.out.println(c(4, 5, 7));
    System.out.println(c(4, 5, 0));
    System.out.println(c(9999, 23, 0));
    System.out.println(c(12345613, 2321, 89));
  }
}

Output:
0.5
0.50
1.857142857142857142857142857
0.6
0.8000000
0
434
5319.09220163722533390779836277466609220163722533390779836277466609220163722533390779836277466

I don't think this is valid, because it's essentially floating-point division, even though it's called divide and not /.

@corvus_192 Another deleted Java answer that posted later than me had the reasoning, which I'll copy-paste here (Credit for this explanation goes to @SocraticPhoenix): "How It Works: Java BigDecimals are implemented as BigIntegers, with a scale. This is technically floating point, however the BigInteger and BigDecimal objects use only the int type to store numerical value. (Isn't that cool? BigInteger is an int[] of digits. Like, {1,2,5} in base 10 is 125. I'm not sure what base the digits of BigInteger are actually in, but I would guess it's more than 10."

Ruby, 67 bytes
->(a,b,c){('0'+(a*10**c/b).to_s).gsub(/^0*(.+)(.{#{c}})$/,'\1.\2')}

if I make it a function to execute the test cases above
def print(a,b,c); ('0'+(a*10**c/b).to_s).gsub(/^0*(.+)(.{#{c}})$/, '\1.\2'); end
 => :print
print(1,2,1)   # would print 0.5
 => "0.5"
print(1,2,2)   # would print 0.50
 => "0.50"
print(13,7,27) # would print 1.857142857142857142857142857
 => "1.857142857142857142857142857"
print(2,3,1)   # would print 0.6
 => "0.6"
print(4,5,7)   # would print 0.8000000
 => "0.8000000"
print(4,5,1)   # would print 0.8
 => "0.8"
print(9999,23,1) # would print 434.7
 => "434.7"
print(12345613,2321,89) # would print if your Language has 32 bit unsigned 5319.09220163722533390779836277466609220163722533390779836277466609220163722533390779836277466
 => "5319.09220163722533390779836277466609220163722533390779836277466609220163722533390779836277466"
"('0'+(a*10**c/b).to_s).gsub(/^0*(.+)(.{#{c}})$/, '\1.\2')".length
 => 52

Welcome to code golf! For most languages, when you define a function, you have to define it all the way, and you can't rely on assuming there are predefined variables like that. In Ruby, the shortest way to define a lambda is with ->a,b,c{...} where you replace the ellipses with your code. (The actual assigning of the variable is unneeded by consensus.)

thanks, I was under the wrong impression that others had left out that part... but you're right. I just added it.

Pyth - 21 19 18 16 14 bytes
Will be looking over the input format, that can prolly save a bunch.
j\.c`/*E^TQE]_

Test Suite. (P.S. the 27 one doesn't finish online, so I did 10 instead).

@Emigna Nor does it have to since 0 is not a positive integer (even though the op keeps adding examples with c=0)

@TonHospel: Ah, indeed. I was looking at the examples. I can shorten my answer then :)

Doesn't work with numbers that has a leading 0 after the decimal point, for example 2/21 to 10 decimals.

2/21 with 10 digits print only 9 digit after the point

2/21 with 10 digits as Emigna says instead of 0.09... print 0.9...

JavaScript (ES6),  64  62 59 bytes
Saved 2 bytes thanks to ETHproductions.
The included division always results in an integer.

f=(a,b,n,s)=>~n?f((q=(a-a%b)/b,a%b*10),b,n-1,s?s+q:q+'.'):s

console.log(f(13,7,27))

Would skipping m altogether still work? f=(a,b,n,s)=>n+1?f((q=(a-a%b)/b,a%b*10),b,n-1,s?s+q:q+'.'):s is 60 bytes.

@ETHproductions - Indeed. Thanks!

q, 196 bytes
w:{((x 0)div 10;1+x 1)}/[{0<x 0};(a;0)]1;{s:x 0;m:x 2;r:(10*x 1)+$[m<0;{x*10}/[-1*m;a];{x div 10}/[m;a]]mod 10;d:1#.Q.s r div b;($[m=-1;s,".",d;$[s~,:'["0"];d;s,d]];r mod b;m-1)}/[c+w;("";0;w-1)]0

To run: set a, b, c first.

Rust, 114 bytes
fn print(mut a:u32,b:u32,c:u32){let mut p=||{print!("{}",a/b);a=a%b*10};p();if c>0{print!(".")}for _ in 0..c{p()}}

test code:
fn main() {
    print(1, 2, 1);    println!(""); // should print 0.5
    print(1, 2, 2);    println!(""); // should print 0.50
    print(13, 7, 27);  println!(""); // should print 1.857142857142857142857142857
    print(2, 3, 1);    println!(""); // should print 0.6
    print(4, 5, 7);    println!(""); // should print 0.8000000
    print(4, 5, 0);    println!(""); // should print 0
    print(9999, 23, 0);println!(""); // should print 434
    print(12345613,2321,89); println!("\n");  // 5319.09220163722533390779836277466609220163722533390779836277466609220163722533390779836277466
}

PHP, 89 bytes
list(,$a,$b,$c)=$argv;for($o=intdiv($a,$b).'.';$c--;)$o.=intdiv($a=10*($a%$b),$b);echo$o;

intdiv() is introduced in php 7 so it requires that. php 7.1 would allow me to change the list() to [] and so would save 4 bytes.
use like:
php -r "list(,$a,$b,$c)=$argv;for($o=intdiv($a,$b).'.';$c--;)$o.=intdiv($a=10*($a%$b),$b);echo$o;" 1 2 1

replace $o.=intdiv($a=10*($a%$b),$b); with $o.=($a=10*($a%$b))/$b^0; will save 4 Bytes.

Initially I was going to take that advice (I edited the answer and everything) but on second thought it IS floating point division and then a cast to int so for a <10% increase in length I'd rather stick completely within the specs of the question.

C#, 126 bytes
(a,b,c)=>{var v=a*BigInteger.Parse("1"+new string('0',c))/b+"";return v.PadLeft(c+1,'0').Insert(Math.Max(1,v.Length-c),".");};

Full program with test cases:
using System;
using System.Numerics;

namespace DivisionOfNotSoLittleNumbers
{
    class Program
    {
        static void Main(string[] args)
        {
            Func<BigInteger,BigInteger,int,string>f= (a,b,c)=>{var v=a*BigInteger.Parse("1"+new string('0',c))/b+"";return v.PadLeft(c+1,'0').Insert(Math.Max(1,v.Length-c),".");};

            //test cases:
            Console.WriteLine(f(1,2,1));    //0.5
            Console.WriteLine(f(1,2,2));    //0.50
            Console.WriteLine(f(13,7,27));  //1.857142857142857142857142857
            Console.WriteLine(f(2,3,1));    //0.6
            Console.WriteLine(f(4,5,7));    //0.8000000
            Console.WriteLine(f(4,5,1));    //0.8
            Console.WriteLine(f(9999,23,1));    //434.7
            Console.WriteLine(f(12345613,2321,89)); //5319.09220163722533390779836277466609220163722533390779836277466609220163722533390779836277466
            Console.WriteLine(f(2,3,1));    //0.6
            Console.WriteLine(f(4,5,2));    //0.80
        }
    }
}

Integer division is implemented. Numbers of any size can be used, due to the BigInteger data type (the import System.Numerics is required). The digit-count parameter c is restricted to 2^31-1, however it should provide more than enough digits.

Groovy (78 77 42 Bytes)
{a,b,n->Eval.me(a+'.0g').divide(b, n, 1)}

Explanation
Eval.me(a+'.0g'); - Convert from integer input to BigDecimal input. In groovy BigDecimal notation is double notation with an appended G or g. I could've also used the constructor new BigDecimal(it) but this saved a byte.
.divide(b, n, 1) - Divide by b with n precision, rounding mode half-up.
Try it here: https://groovyconsole.appspot.com/script/5177545091710976

But BigDecimal supports floating point operation which, unless I am mistaken, I believe was indicated to be forbidden for this exercise.

Batch, 122 bytes
@set/as=%1/%2,r=%1%%%2
@set s=%s%.
@for /l %%a in (1,1,%3)do @set/ad=r*10/%2,r=r*10%%%2&call set s=%%s%%%%d%%
@echo %s%

Mathematica, 50 bytes
StringInsert[ToString@Floor[10^# #2/#3],".",-#-1]&

Unnamed function of three arguments (which are ordered c, a, b to save a byte somewhere), which returns a string. It multiplies a/b by 10^c, takes the greatest integer function, then converts to a string and inserts a decimal point at the appropriate spot. Too bad the function names aren't shorter.

Python 3, 62 Bytes
a,b,c=map(int,input().split());print("{:.{1}f}".format(a/b,c))

Try It Here
*Note: repl.it uses an older ver of Python 3, which requires all field indices to be specified, meaning "{:.{1}f}" will be "{0:.{1}f}" instead, making it 63 bytes in repl.it
How to use
Enter all three values with spaces in-between. i.e. An input of 1 2 1 would give a result of 0.5
Explanation
input().split(): Gets user input and splits it into a list with a separator of (space)
a,b,c = map(int,XX): Maps the variables into the values specified by the user with an int type
"{:.{1}f}".format(a/b,c): Formats a string to display the division result and substitutes {1} with c to set the decimal place of the displayed string
print(XX): prints the string supplied

Stax, 13 bytes
ä·oαì█↕▬AS¥é▼

Run and debug it
Arguments are accepted in c a b order.

The problem would be the case "print(9999,23,1)" the result print in the post is "434.7" while your result seems "4.7" the same the case last: 5319.092201etc instead of 9.092201etc

I not agree... I followed this morning your link and the result for the case "print(9999,23,1)" in your function order was 4.7 and not 434.7

@RosLuP: I changed the approach.  The result is now correctly  434.7.  I also reduced the size by a byte in the process.

Python 3, 58 bytes
lambda a,b,c:(lambda s:s[:-c]+"."+s[-c:])(str(a*10**c//b))

Try it online!
This is precise to the specified number of decimals as long as a * 10 ** c isn't too large.
I tried Python 2 to shorten the str(...) to `...` but Python 2 inserts an L at the end if it's too large so checking for that would take way more bytes than it's worth.

C, 67 bytes
h(a,b,i){int j=!i;for(;printf(j++?"%u":"%u.",a/b),i--;a=10*(a%b));}

Try it online!
Some previous version I think had a bug in read memory out of assigned to the program...Thanks to ceilingcat and for all...

@ceilingcat ok thank you

I like the last one 69 bytes

62 bytes

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/

sort: votes


text:
Square, diamond, square, diamond
Task
Given a non-empty string of lowercase ASCII letters a-z, take its first character, and:

Surround it with a square of copies of the second character,
Surround that with a diamond of copies of the third character,
Surround that with a square of copies of the fourth character…

…alternating between square and diamond borders until the end of the string. Empty space between the borders should be represented by ASCII spaces ().
To add a square border, draw a square exactly around the entire current “working array”:
                                               sssssssssss
                                t              s    t    s
                               t t             s   t t   s
                              t   t            s  t   t  s
                             t aaa t           s t aaa t s
                            t  aca  t    =>    st  aca  ts
                             t aaa t           s t aaa t s
                              t   t            s  t   t  s
                               t t             s   t t   s
                                t              s    t    s
                                               sssssssssss

To add a diamond border, draw a centered diamond shape that touches the outermost square diagonally, but not orthogonally:
                                                     s
                                                    s s
                                                   s   s
                                                  s     s
                                                 s       s
                                                s         s
                                               s           s
                    wwwwwwwwwww               s wwwwwwwwwww s
                    w    o    w              s  w    o    w  s
                    w   o o   w             s   w   o o   w   s
                    w  o   o  w            s    w  o   o  w    s
                    w o eee o w           s     w o eee o w     s
                    wo  eme  ow    =>    s      wo  eme  ow      s
                    w o eee o w           s     w o eee o w     s
                    w  o   o  w            s    w  o   o  w    s
                    w   o o   w             s   w   o o   w   s
                    w    o    w              s  w    o    w  s
                    wwwwwwwwwww               s wwwwwwwwwww s
                                               s           s
                                                s         s
                                                 s       s
                                                  s     s
                                                   s   s
                                                    s s
                                                     s

Your program must output the final array.

Each line may contain any amount of trailing spaces.
You may output a list of strings representing lines, or a single newline-separated string with an optional trailing newline.
Leading/trailing blank lines are disallowed.
Leading columns of spaces are also disallowed.

This is code-golf. The shortest code in bytes wins.
Test cases
The above examples are expected outputs for cat, cats, meow, and meows, in reading order. Some other cases worth handling:

For the input a, your program should output:
a

For the input ab, your program should output:
bbb
bab
bbb

For the input codegolf, your program should output:
fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
f                            l                            f
f                           l l                           f
f                          l   l                          f
f                         l     l                         f
f                        l       l                        f
f                       l         l                       f
f                      l           l                      f
f                     l             l                     f
f                    l               l                    f
f                   l                 l                   f
f                  l                   l                  f
f                 l                     l                 f
f                l                       l                f
f               l                         l               f
f              l                           l              f
f             l ooooooooooooooooooooooooooo l             f
f            l  o            g            o  l            f
f           l   o           g g           o   l           f
f          l    o          g   g          o    l          f
f         l     o         g     g         o     l         f
f        l      o        g       g        o      l        f
f       l       o       g         g       o       l       f
f      l        o      g           g      o        l      f
f     l         o     g eeeeeeeeeee g     o         l     f
f    l          o    g  e    d    e  g    o          l    f
f   l           o   g   e   d d   e   g   o           l   f
f  l            o  g    e  d   d  e    g  o            l  f
f l             o g     e d ooo d e     g o             l f
fl              og      ed  oco  de      go              lf
f l             o g     e d ooo d e     g o             l f
f  l            o  g    e  d   d  e    g  o            l  f
f   l           o   g   e   d d   e   g   o           l   f
f    l          o    g  e    d    e  g    o          l    f
f     l         o     g eeeeeeeeeee g     o         l     f
f      l        o      g           g      o        l      f
f       l       o       g         g       o       l       f
f        l      o        g       g        o      l        f
f         l     o         g     g         o     l         f
f          l    o          g   g          o    l          f
f           l   o           g g           o   l           f
f            l  o            g            o  l            f
f             l ooooooooooooooooooooooooooo l             f
f              l                           l              f
f               l                         l               f
f                l                       l                f
f                 l                     l                 f
f                  l                   l                  f
f                   l                 l                   f
f                    l               l                    f
f                     l             l                     f
f                      l           l                      f
f                       l         l                       f
f                        l       l                        f
f                         l     l                         f
f                          l   l                          f
f                           l l                           f
f                            l                            f
fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff

Reference implementation
I wrote some Julia code that your program’s output should match (at least visually). Try it online!

MATL, 63 54 bytes
l&)"X@o?TT@I$Ya}t&n2/Xkw2+-|thYa9Mqt_w&:|&+tleXM=@*+]c

Try it Online!
Explanation
            % Implicitly grab the input as a string
l&)         % Separate the first letter from the rest and push them onto the stack
"           % For every letter in the string besides the first
  X@o?      % If this is an odd iteration through the loop
    TT      % Push the array [1, 1]
    @       % Get current character
    I$Ya    % Pad the matrix with 1 copy of this character on all sides
  }         % Else (this is a diamond)
    t       % Duplicate the matrix
    &n      % Determine the number of rows and columns (push separately to stack)
    2/Xk    % Compute the radius (half the # of columns rounded up)
    w2+     % Flip the stack to get the # of rows and add 2. This is the new radius.
    -|      % Subtract the new and old radii and take the absolute value
    thYa    % Apply the necessary number of padding zeros to the matrix
    9Mqt_w&:% Generate the array [-radius ... 0 ... radius]
    |&+     % Take the absolute value and compute the element-wise sum with itself
            % and automatically broadcast to a matrix. For a radius of 5 this yields
            % the following:
            %
            %   8   7   6   5   4   5   6   7   8
            %   7   6   5   4   3   4   5   6   7
            %   6   5   4   3   2   3   4   5   6
            %   5   4   3   2   1   2   3   4   5
            %   4   3   2   1   0   1   2   3   4
            %   5   4   3   2   1   2   3   4   5
            %   6   5   4   3   2   3   4   5   6
            %   7   6   5   4   3   4   5   6   7
            %   8   7   6   5   4   5   6   7   8
            %
    tleXM   % Duplicate and compute the mode of this matrix (4 in the example above)
    =@*     % Find the locations where the matrix is equal to the mode and
            % replace with the current character. Set all else to 0.
    +       % Add this to the padded version of the previous iteration.
 ]          % End of if...else
 c          % Cast the current matrix as a character array (zeros are spaces)
            % Implicit end of for loop and implicit display

JavaScript (ES6), 294 288 287 284 256 246 240 238 220 bytes
My first golf on this site. Pass input string to function f, e.g. f('codegolf')

f=s=>{N=n=>(2<<n/2+.5)-3-n%2
D=N(l=s.length)
for(a=[],i=S=D*2+1;i--;)a[i]=a[S+~i]=Array(S).fill` `
for(;l--;)for(o=n=N(l+1),I=0;I<=n;I++,o-=~l&1)a[y=D+I][x=D+o]=a[x][y]=a[y][D-o]=a[x][D-I]=s[l]
return a.map(r=>r.join``)}

-6 bytes thanks to @Sunny Pun: Remove parentheses when passing template strings.
-2 bytes thanks to @ETHproductions: Change S-i-1 to S+~i, l%2||o-- to o-=~l&1.
-18 bytes per suggestions of @Sunny Pun, @edc65: Remove prompt() and console.log() in favor of function format, don't .join() final array of strings

I count 256 bytes. Any chance you're counting the newlines as two bytes each (\r\n) instead of one (\n)?

Making it a function should save bytes by removing prompt and console.log.  Also you may use template strings which saves you 2 bytes per function call on Strings (like fill(' ') becomes fill\ ``)

Welcome to PPCG! To go along with what the others have said, you can shorten S-i-1 to S+~i, and i%2||o-- to o-=~i&1.

@Mego Rechecked the count, 256 is correct. Thanks!

I think a=Array(D*2+1).fill .map((_,$,a)=>[...a]) saves you 10 bytes.

@Sunny Pun, ETHproductions, edc65 Thanks a lot for all your suggestions!

@Neil That won't work, as I rely on the fact that the arrays in the top half are also referenced in the bottom half.

Haskell, 138 137 136 bytes
q 1=0
q x=(mod x 2+1)*(q(x-1)+1)
f x|m<-q$length x,n<-abs<$>[-m..m]=[do j<-n;max" "[c|(k,c)<-zip[1..]x,cycle[max i j,i+j]!!k==q k]|i<-n]

Defines a function f which returns the result as a list of lines
-1 byte thanks to @Lynn

C++ - 373 366 362 359 bytes
-1 by @TuukkaX, -6 by @Kevin Cruijssen, -4 by imports, -3 by @Baum mit Augen
#import<string>
#import<vector>
#define A(x) abs(x-r)
using S=std::string;using V=std::vector<S>;int R(int n){return n?(n%2)?R(n-1)+1:2*R(n-1)+2:0;}V f(S w){int l=w.size(),r=R(l-1),s=r*2+1,i,j,k;V x(s);for(i=0;i<s;++i){x[i]=S(s,46);for(j=0;j<s;++j)for(k=0;k<l;++k){if(A(i)<=R(k)&A(j)<=R(k)&k%2?A(i)==R(k)|A(j)==R(k):(A(i)+A(j)==R(k)))x[i][j]=w[k];}}return x;}

http://ideone.com/5y54mx
Note: This solution uses the dot ('.') as "space" character to make the empty spaces more visible. To use a space instead, one has to change S(s,46) to S(s,32). The score remains the same.
Ungolfed:
#import<string>
#import<vector>

#define A(x) abs(x-r) //r will be the center coordinate

using S=std::string;
using V=std::vector<S>;

int R(int n){ //recursive function returning the radius of a square/diamond
    return n?  //if(n!=0)
        (n%2)? //if(n%2 != 0)
            R(n-1)+1 //square -> just increase radius by 1
        :
            2*R(n-1)+2 //diamond -> radius doubles + 2
    :
        0 //n==0 -> end of recursion
    ;
}

V f(S w){ //function taking a string and returning a vector<string>
    int l=w.size(),r=R(l-1),s=r*2+1,i,j,k;  //r is radius (==center coord), s is size
    V x(s);  //vector<string>
    for(i=0;i<s;++i){  //loop over vector
        x[i]=S(s,46); //initialize string with dots. use 32 for spaces
        for(j=0;j<s;++j)
            for(k=0;k<l;++k){ //loop over word
                if(
                    A(i)<=R(k) //check bounds
                    &
                    A(j)<=R(k)
                    &
                    k%2?A(i)==R(k)|A(j)==R(k):(A(i)+A(j)==R(k))
                    //for square: check if distance to center of one coordinate = R
                    //for diamond: check if sum of distances = R
                )
                    x[i][j]=w[k]; //if any is true, replace default char
            }
    }

    return x;
}

Try ungolfed online
How to use:
include<iostream>

void printSquare(std::string word){
    auto result = f(word);
    for(auto& s:result)
        std::cout << s << std::endl;
    std::cout << std::endl << std::endl;
}

int main() {
    printSquare("a");
    printSquare("ab");
    printSquare("cat");
    printSquare("cats");
    printSquare("meow");
    printSquare("meows");
    printSquare("codegolf");
    return 0;
}

Output:
a

bbb
bab
bbb

....t....
...t.t...
..t...t..
.t.aaa.t.
t..aca..t
.t.aaa.t.
..t...t..
...t.t...
....t....

sssssssssss
s....t....s
s...t.t...s
s..t...t..s
s.t.aaa.t.s
st..aca..ts
s.t.aaa.t.s
s..t...t..s
s...t.t...s
s....t....s
sssssssssss

wwwwwwwwwww
w....o....w
w...o.o...w
w..o...o..w
w.o.eee.o.w
wo..eme..ow
w.o.eee.o.w
w..o...o..w
w...o.o...w
w....o....w
wwwwwwwwwww

............s............
...........s.s...........
..........s...s..........
.........s.....s.........
........s.......s........
.......s.........s.......
......s...........s......
.....s.wwwwwwwwwww.s.....
....s..w....o....w..s....
...s...w...o.o...w...s...
..s....w..o...o..w....s..
.s.....w.o.eee.o.w.....s.
s......wo..eme..ow......s
.s.....w.o.eee.o.w.....s.
..s....w..o...o..w....s..
...s...w...o.o...w...s...
....s..w....o....w..s....
.....s.wwwwwwwwwww.s.....
......s...........s......
.......s.........s.......
........s.......s........
.........s.....s.........
..........s...s..........
...........s.s...........
............s............

fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
f............................l............................f
f...........................l.l...........................f
f..........................l...l..........................f
f.........................l.....l.........................f
f........................l.......l........................f
f.......................l.........l.......................f
f......................l...........l......................f
f.....................l.............l.....................f
f....................l...............l....................f
f...................l.................l...................f
f..................l...................l..................f
f.................l.....................l.................f
f................l.......................l................f
f...............l.........................l...............f
f..............l...........................l..............f
f.............l.ooooooooooooooooooooooooooo.l.............f
f............l..o............g............o..l............f
f...........l...o...........g.g...........o...l...........f
f..........l....o..........g...g..........o....l..........f
f.........l.....o.........g.....g.........o.....l.........f
f........l......o........g.......g........o......l........f
f.......l.......o.......g.........g.......o.......l.......f
f......l........o......g...........g......o........l......f
f.....l.........o.....g.eeeeeeeeeee.g.....o.........l.....f
f....l..........o....g..e....d....e..g....o..........l....f
f...l...........o...g...e...d.d...e...g...o...........l...f
f..l............o..g....e..d...d..e....g..o............l..f
f.l.............o.g.....e.d.ooo.d.e.....g.o.............l.f
fl..............og......ed..oco..de......go..............lf
f.l.............o.g.....e.d.ooo.d.e.....g.o.............l.f
f..l............o..g....e..d...d..e....g..o............l..f
f...l...........o...g...e...d.d...e...g...o...........l...f
f....l..........o....g..e....d....e..g....o..........l....f
f.....l.........o.....g.eeeeeeeeeee.g.....o.........l.....f
f......l........o......g...........g......o........l......f
f.......l.......o.......g.........g.......o.......l.......f
f........l......o........g.......g........o......l........f
f.........l.....o.........g.....g.........o.....l.........f
f..........l....o..........g...g..........o....l..........f
f...........l...o...........g.g...........o...l...........f
f............l..o............g............o..l............f
f.............l.ooooooooooooooooooooooooooo.l.............f
f..............l...........................l..............f
f...............l.........................l...............f
f................l.......................l................f
f.................l.....................l.................f
f..................l...................l..................f
f...................l.................l...................f
f....................l...............l....................f
f.....................l.............l.....................f
f......................l...........l......................f
f.......................l.........l.......................f
f........................l.......l........................f
f.........................l.....l.........................f
f..........................l...l..........................f
f...........................l.l...........................f
f............................l............................f
fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+............................................................+............................................................+
+...........................................................+.+...........................................................+
+..........................................................+...+..........................................................+
+.........................................................+.....+.........................................................+
+........................................................+.......+........................................................+
+.......................................................+.........+.......................................................+
+......................................................+...........+......................................................+
+.....................................................+.............+.....................................................+
+....................................................+...............+....................................................+
+...................................................+.................+...................................................+
+..................................................+...................+..................................................+
+.................................................+.....................+.................................................+
+................................................+.......................+................................................+
+...............................................+.........................+...............................................+
+..............................................+...........................+..............................................+
+.............................................+.............................+.............................................+
+............................................+...............................+............................................+
+...........................................+.................................+...........................................+
+..........................................+...................................+..........................................+
+.........................................+.....................................+.........................................+
+........................................+.......................................+........................................+
+.......................................+.........................................+.......................................+
+......................................+...........................................+......................................+
+.....................................+.............................................+.....................................+
+....................................+...............................................+....................................+
+...................................+.................................................+...................................+
+..................................+...................................................+..................................+
+.................................+.....................................................+.................................+
+................................+.......................................................+................................+
+...............................+.........................................................+...............................+
+..............................+...........................................................+..............................+
+.............................+.CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC.+.............................+
+............................+..C............................r............................C..+............................+
+...........................+...C...........................r.r...........................C...+...........................+
+..........................+....C..........................r...r..........................C....+..........................+
+.........................+.....C.........................r.....r.........................C.....+.........................+
+........................+......C........................r.......r........................C......+........................+
+.......................+.......C.......................r.........r.......................C.......+.......................+
+......................+........C......................r...........r......................C........+......................+
+.....................+.........C.....................r.............r.....................C.........+.....................+
+....................+..........C....................r...............r....................C..........+....................+
+...................+...........C...................r.................r...................C...........+...................+
+..................+............C..................r...................r..................C............+..................+
+.................+.............C.................r.....................r.................C.............+.................+
+................+..............C................r.......................r................C..............+................+
+...............+...............C...............r.........................r...............C...............+...............+
+..............+................C..............r...........................r..............C................+..............+
+.............+.................C.............r.ooooooooooooooooooooooooooo.r.............C.................+.............+
+............+..................C............r..o............F............o..r............C..................+............+
+...........+...................C...........r...o...........F.F...........o...r...........C...................+...........+
+..........+....................C..........r....o..........F...F..........o....r..........C....................+..........+
+.........+.....................C.........r.....o.........F.....F.........o.....r.........C.....................+.........+
+........+......................C........r......o........F.......F........o......r........C......................+........+
+.......+.......................C.......r.......o.......F.........F.......o.......r.......C.......................+.......+
+......+........................C......r........o......F...........F......o........r......C........................+......+
+.....+.........................C.....r.........o.....F.eeeeeeeeeee.F.....o.........r.....C.........................+.....+
+....+..........................C....r..........o....F..e....t....e..F....o..........r....C..........................+....+
+...+...........................C...r...........o...F...e...t.t...e...F...o...........r...C...........................+...+
+..+............................C..r............o..F....e..t...t..e....F..o............r..C............................+..+
+.+.............................C.r.............o.F.....e.t.ooo.t.e.....F.o.............r.C.............................+.+
++..............................Cr..............oF......et..oVo..te......Fo..............rC..............................++
+.+.............................C.r.............o.F.....e.t.ooo.t.e.....F.o.............r.C.............................+.+
+..+............................C..r............o..F....e..t...t..e....F..o............r..C............................+..+
+...+...........................C...r...........o...F...e...t.t...e...F...o...........r...C...........................+...+
+....+..........................C....r..........o....F..e....t....e..F....o..........r....C..........................+....+
+.....+.........................C.....r.........o.....F.eeeeeeeeeee.F.....o.........r.....C.........................+.....+
+......+........................C......r........o......F...........F......o........r......C........................+......+
+.......+.......................C.......r.......o.......F.........F.......o.......r.......C.......................+.......+
+........+......................C........r......o........F.......F........o......r........C......................+........+
+.........+.....................C.........r.....o.........F.....F.........o.....r.........C.....................+.........+
+..........+....................C..........r....o..........F...F..........o....r..........C....................+..........+
+...........+...................C...........r...o...........F.F...........o...r...........C...................+...........+
+............+..................C............r..o............F............o..r............C..................+............+
+.............+.................C.............r.ooooooooooooooooooooooooooo.r.............C.................+.............+
+..............+................C..............r...........................r..............C................+..............+
+...............+...............C...............r.........................r...............C...............+...............+
+................+..............C................r.......................r................C..............+................+
+.................+.............C.................r.....................r.................C.............+.................+
+..................+............C..................r...................r..................C............+..................+
+...................+...........C...................r.................r...................C...........+...................+
+....................+..........C....................r...............r....................C..........+....................+
+.....................+.........C.....................r.............r.....................C.........+.....................+
+......................+........C......................r...........r......................C........+......................+
+.......................+.......C.......................r.........r.......................C.......+.......................+
+........................+......C........................r.......r........................C......+........................+
+.........................+.....C.........................r.....r.........................C.....+.........................+
+..........................+....C..........................r...r..........................C....+..........................+
+...........................+...C...........................r.r...........................C...+...........................+
+............................+..C............................r............................C..+............................+
+.............................+.CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC.+.............................+
+..............................+...........................................................+..............................+
+...............................+.........................................................+...............................+
+................................+.......................................................+................................+
+.................................+.....................................................+.................................+
+..................................+...................................................+..................................+
+...................................+.................................................+...................................+
+....................................+...............................................+....................................+
+.....................................+.............................................+.....................................+
+......................................+...........................................+......................................+
+.......................................+.........................................+.......................................+
+........................................+.......................................+........................................+
+.........................................+.....................................+.........................................+
+..........................................+...................................+..........................................+
+...........................................+.................................+...........................................+
+............................................+...............................+............................................+
+.............................................+.............................+.............................................+
+..............................................+...........................+..............................................+
+...............................................+.........................+...............................................+
+................................................+.......................+................................................+
+.................................................+.....................+.................................................+
+..................................................+...................+..................................................+
+...................................................+.................+...................................................+
+....................................................+...............+....................................................+
+.....................................................+.............+.....................................................+
+......................................................+...........+......................................................+
+.......................................................+.........+.......................................................+
+........................................................+.......+........................................................+
+.........................................................+.....+.........................................................+
+..........................................................+...+..........................................................+
+...........................................................+.+...........................................................+
+............................................................+............................................................+
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

std::vector<S> V has an useless whitespace.

Impressive answer! +1 You can golf it some more though: In if(A(i)<=R(k)&&A(j)<=R(k)&&k%2?A(i)==R(k)||A(j)==R(k) the && and || can be & and | for -3 bytes; and int r=R(w.size()-1),... can become int l=w.size(),r=R(l-1),... and for(k=0;k<w.size();++k) can then become for(k=0;k<l;++k) for another -3 bytes.

saved another 4 bytes by using #import and importing string instead of iostream. iostream is only neccessary for printSquare();

As of C++11, you can use using S=std::string; to safe two bytes per typedef.

With C++17, size(w) instead of w.size() safes another one.

@BaummitAugen: using saves 3 bytes total, since there is already no whitespace in the vector typedef. And i rather stick to C++14, since C++17 is stil WIP as far as i'm aware. Thx anyway for another 3 bytes, YAY!

@Anedar True, noticed that too late. You're welcome. :)

As per the description Empty space between the borders should be represented by ASCII spaces. You're not doing that.

@grooveplex As stated in the answer: "Note: This solution uses the dot ('.') as "space" character to make the empty spaces more visible. To use a space instead, one has to change S(s,46) to S(s,32). The score remains the same."

Mathematica, 167 bytes
Grid@Fold[g=Normal@SparseArray[h=f;a_List/;Plus@@Abs[a-#-1]==#->#3,2{#,#}+1]+a[#2,#/2+1]&[Length@#+1,#,#2]&;h=f=(h=g;a=ArrayPad)[#,1,#2]&;h@##&,{{#}},{##2}]/.Rule[0,]&

The input must be a list of characters.
e.g.
Grid@Fold[ ... ]/.Rule[0,]&["i","n","p","u","t"]

JavaScript (ES6), 252 bytes

f=([c,...r],a,n,d)=>c?a?d?f(r,[...Array(m=n+n+3)].map((_,i,b)=>b.map((_,j)=>(a[i-g]||[])[j-g]||(i+j-h&&j+h-i&&h+i-j&&i+j-h*3?` `:c)),h=m>>1,g=m-n>>1),m,0):f(r,[b=[...a].fill(c),...a,b].map(b=>[c,...b,c]),n+2,1):f(r,[[c]],1,0):a.map(b=>b.join``).join`\n`
<input oninput=o.textContent=this.value&&f(this.value)><pre id=o>

Where \n represents the literal newline character.

JavaScript (ES6), 204 229 238
An anonymous function returning an array of strings
s=>[...s].map(v=>{T=(x,y)=>((r=[...c[y+z]||' '.repeat(z+z)])[z+x]=r[z-x]=v,c[z+y]=c[z-y]=r.join``);for(y=o-~o,o*=++i%2+1;y--;i%2?T(q,y):T(o,q,T(q,o)))q=y-o;++o},l=s.length,z=(2<<-~l/2)-3-l%2,c=[i=o=0])&&c

Less golfed
s=>(
  l = s.length,
  z = (2 << l/2 + .5) - 3 - l%2, // zero position, total width and height are z+z+1
  c = [], // output canvas
  o = 0, // base drawing offset from z
  [...s].map( (v, i) => {
    // execute for each char v at position i in input string
    // helper function to put current char v at position (z+y, z+x),(z+y,z-x),(z-y,z+x),(z-y,z-x)
    // as the image has vertical and horizontal symmetry
    T=(x,y) =>(
      r = [...c[y+z]||' '.repeat(z+z)]), // convert string to array to set char at given pos
      r[z+x] = v,
      r[z-x] = v,
      c[z+y] = c[z-y] = r.join`` // array to string again
    );
    // shorter than if(i%2) {for ...}else{for ...}
    // o is doubled at every other step
    //   and incremented (below) at each step
    for(y=o+o, i % 2 ? 0 : o=o*2; y >= 0; y--)
      q = y-o,
      i % 2 // even and odd steps have different shapes
        ? ( T(o,q), T(q,o))
        : T(q,y);
    ++o
  }),
  c
)

Test

f=
s=>[...s].map(v=>{T=(x,y)=>((r=[...c[y+z]||' '.repeat(z+z)])[z+x]=r[z-x]=v,c[z+y]=c[z-y]=r.join``);for(y=o-~o,o*=++i%2+1;y--;i%2?T(q,y):T(o,q,T(q,o)))q=y-o;++o},l=s.length,z=(2<<-~l/2)-3-l%2,c=[i=o=0])&&c

function update()
{
  O.textContent=f(I.value).join`\n`
}

update()
<input id=I value=CodeGolf oninput='update()'>
<pre id=O></pre>

Java - 429 417 bytes
int r,l;int D(int n){return Math.abs(n-r);}int R(int n){return n=(n!=0)?((n%2!=0)?(R(n-1)+1):(2*R(n-1))+2):n;}char[][]C(String a){char[]c=a.toCharArray();l=a.length();r=R(l-1);int s=r*2+1,i,j,k;char[][]x=new char[s][s];for(i=0;i<s;i++){for(j=0;j<s;j++){x[i][j]=' ';for(k=0;k<l;k++){if(D(i)<=R(k)&&D(j)<=R(k)){if(k%2!=0){if(D(i)==R(k)||D(j)==R(k)){x[i][j]=c[k];}}else{if(D(i)+D(j)==R(k)){x[i][j]=c[k];}}}}}}return x;}

Credit goes to @Anedar as it was an influence on the structure of this answer
Ungolfed:
int r, l;

int D(int n) {
    return Math.abs(n - r);
}

int R(int n) {
    return n = (n != 0) ? ((n % 2 != 0) ? (R(n - 1) + 1) : (2 * R(n - 1)) + 2) : n;
}

char[][] C(String a) {
    char[] c = a.toCharArray();
    l = a.length();
    r = R(l - 1);
    int s = r * 2 + 1, i, j, k;
    char[][] x = new char[s][s];
    for (i = 0; i < s; i++) {
        for (j = 0; j < s; j++) {
            x[i][j] = ' ';
            for (k = 0; k < l; k++) {
                if (D(i) <= R(k) && D(j) <= R(k)) {
                    if (k % 2 != 0) {
                        if (D(i) == R(k) || D(j) == R(k)) {
                            x[i][j] = c[k];
                        }
                    } else if (D(i) + D(j) == R(k)) {
                        x[i][j] = c[k];
                    }
                }
            }
        }
    }
    return x;
}

JavaScript (ES6), 322 bytes
Non Competitive
var L=s=>{var A=Array,a,D,c,d=-1,i,k,w,O,Z,P=(u,v)=>{Z=O-(d>>1);a[D?u-v+O:u+Z][D?u+v+O-d+1:v+Z]=c},G=(c,i)=>(D=~i&1)?(d+=2,w=2*d-1):(d+=d+1,w=d);s=[...s];s.map(G);a=A(w).fill(0).map(a=>A(w).fill` `);O=w>>1;d=-1;s.map((C,i)=>{G(0,i);c=C;for(k=d;k--;)P(0,k),P(d-1,k),P(k,0),P(k,d-1)});return a.map(v=>v.join("")).join("\n")}

Less Golphed
var L=s=>{
    var A=Array,a,D,c,d=-1,i,k,w,O,Z
    P=(u,v)=>{
        Z=O-(d>>1)
        a[D?u-v+O:u+Z][D?u+v+O-d+1:v+Z]=c},
    G=(c,i)=>(D=~i&1)?(d+=2,w=2*d-1):(d+=d+1,w=d)
    s=[...s]
    s.map(G)
    a=A(w).fill(0).map( a=>A(w).fill` `)
    O=w>>1
    d=-1
    s.map((C,i)=>{
        G(0,i)
        c=C
        for(k=d;k--;)
            P(0,k),P(d-1,k),P(k,0),P(k,d-1)})
    return a.map(v=>v.join("")).join("\n")
}

Test  with
L("arty*")

Easy gains by leaving out the leading var L= and .join("\n") in the return statement for -17 bytes, but type them back in to test the code :D
It's a two pass answer, evaluating the width (w) required to plot a square or diamond plot, before plotting points with P in the second pass using rotation and translation. d is the dimension (height or width) of an unrotated square before translation or rotation.
Rotation and scale by √2 details from Mathematica answer. Use of tagged string template from first answer in this thread. Thanks to both for the learning. Votes for the question and answers.

Powershell, 269 245 238 bytes
$m,$a=$args
if($a){$a|%{$c=$_
$w=$m[0].Length
$m=&({$i=0
($m|%{$_+'.'*$w+'.'})+(0..$w|%{'..'*$w+'.'})|%{($s=$_|% t*y)[--$i]=$c
-join$s}},{$m|%{$_+$c}
$c*$w+$c})[++$k%2]}
$m=($w=$m[0].Length-1)..1+0..$w|%{$m[$_]|%{-join($_[$w..1]+$_)}}}
$m

Ungolfed, explained & test scripted:
$f={

# $args is input char array
# $m is canvas.
# This script draws a right-bottom quadrant (axes included) on the canvas.
# If $args contains one char only then $m contains this char and whole image at same time.
$m,$a=$args                             # $a is other chars array
if($a){
    $a|%{
        $c=$_                           # $c is current char
        $w=$m[0].Length                 # $w is width of the canvas
        $m=&({                          # $m is the result of executing one of the two scriptblocks
            # draw Diamond quadrant
            $i=0
            ($m|%{$_+'.'*$w+'.'})+      # expand the canvas
            (0..$w|%{'..'*$w+'.'})|%{   # add new lines
                ($s=$_|% t*y)[--$i]=$c  # take a diamond edge on each line of the canvas
                -join$s
            }
        },{
            # draw Square quadrant
            $m|%{$_+$c}                 # expand the canvas
            $c*$w+$c                    # add new line
        })[++$k%2]                      # get a scriptblock from the array and execute it
    }

    # We have a right-bottom part of drawn AsciiArt now. Flip, flip, paste it.
    $w=$m[0].Length-1                   # width of the canvas
    $m=$w..1+0..$w|%{$m[$_]|%{          # flip vertical
        -join($_[$w..1]+$_)             # flip horizontal
    }}
}
$m

}

@(
,('c',@"
c
"@)
,('ca',@"
aaa
aca
aaa
"@)
,('cat',@"
....t....
...t.t...
..t...t..
.t.aaa.t.
t..aca..t
.t.aaa.t.
..t...t..
...t.t...
....t....
"@)
,('cats',@"
sssssssssss
s....t....s
s...t.t...s
s..t...t..s
s.t.aaa.t.s
st..aca..ts
s.t.aaa.t.s
s..t...t..s
s...t.t...s
s....t....s
sssssssssss
"@)
,('meows',@"
............s............
...........s.s...........
..........s...s..........
.........s.....s.........
........s.......s........
.......s.........s.......
......s...........s......
.....s.wwwwwwwwwww.s.....
....s..w....o....w..s....
...s...w...o.o...w...s...
..s....w..o...o..w....s..
.s.....w.o.eee.o.w.....s.
s......wo..eme..ow......s
.s.....w.o.eee.o.w.....s.
..s....w..o...o..w....s..
...s...w...o.o...w...s...
....s..w....o....w..s....
.....s.wwwwwwwwwww.s.....
......s...........s......
.......s.........s.......
........s.......s........
.........s.....s.........
..........s...s..........
...........s.s...........
............s............
"@)
,('codegolf',@"
fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
f............................l............................f
f...........................l.l...........................f
f..........................l...l..........................f
f.........................l.....l.........................f
f........................l.......l........................f
f.......................l.........l.......................f
f......................l...........l......................f
f.....................l.............l.....................f
f....................l...............l....................f
f...................l.................l...................f
f..................l...................l..................f
f.................l.....................l.................f
f................l.......................l................f
f...............l.........................l...............f
f..............l...........................l..............f
f.............l.ooooooooooooooooooooooooooo.l.............f
f............l..o............g............o..l............f
f...........l...o...........g.g...........o...l...........f
f..........l....o..........g...g..........o....l..........f
f.........l.....o.........g.....g.........o.....l.........f
f........l......o........g.......g........o......l........f
f.......l.......o.......g.........g.......o.......l.......f
f......l........o......g...........g......o........l......f
f.....l.........o.....g.eeeeeeeeeee.g.....o.........l.....f
f....l..........o....g..e....d....e..g....o..........l....f
f...l...........o...g...e...d.d...e...g...o...........l...f
f..l............o..g....e..d...d..e....g..o............l..f
f.l.............o.g.....e.d.ooo.d.e.....g.o.............l.f
fl..............og......ed..oco..de......go..............lf
f.l.............o.g.....e.d.ooo.d.e.....g.o.............l.f
f..l............o..g....e..d...d..e....g..o............l..f
f...l...........o...g...e...d.d...e...g...o...........l...f
f....l..........o....g..e....d....e..g....o..........l....f
f.....l.........o.....g.eeeeeeeeeee.g.....o.........l.....f
f......l........o......g...........g......o........l......f
f.......l.......o.......g.........g.......o.......l.......f
f........l......o........g.......g........o......l........f
f.........l.....o.........g.....g.........o.....l.........f
f..........l....o..........g...g..........o....l..........f
f...........l...o...........g.g...........o...l...........f
f............l..o............g............o..l............f
f.............l.ooooooooooooooooooooooooooo.l.............f
f..............l...........................l..............f
f...............l.........................l...............f
f................l.......................l................f
f.................l.....................l.................f
f..................l...................l..................f
f...................l.................l...................f
f....................l...............l....................f
f.....................l.............l.....................f
f......................l...........l......................f
f.......................l.........l.......................f
f........................l.......l........................f
f.........................l.....l.........................f
f..........................l...l..........................f
f...........................l.l...........................f
f............................l............................f
fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
"@)
#,('codegolfes',"")
) | % {
    $s, $e = $_
    $c = $s-split''-ne''
    $r = &$f @c
    $r = $r-join"`n"
    "$($e-eq$r): $s`n$r"
}

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/