gpt-3.5-turbo-0613· OpenAI
WildChat-4.8M (AI2)
Увеличь фигуру в размерах , а так же сделай так чтобы на фигуре отображалась надпись…
- User
Увеличь фигуру в размерах , а так же сделай так чтобы на фигуре отображалась надпись "Here was Ivan" : <?php class Decoder{
const TYPE_MASK = 0b11000000; const W_MASK = 0b00110000; const H_MASK = 0b00001100; const COL_MASK = 0b00000011; private int $type; private string $color; private int $width; private int $height; public function __construct($num) { $this->width = match (($num & self::W_MASK)>>4){ 0 => 20, 1 => 50, 2 => 100, 3 => 250 }; $this->height = match (($num & self::H_MASK)>>2){ 0 => 20, 1 => 50, 2 => 100, 3 => 250 }; $this->color = match ($num & self::COL_MASK){ 0 => '#000000', 1 => '#ff0000', 2 => '#00ff00', 3 => '#0000ff' }; $this->type = ($num & self::TYPE_MASK) >> 6; } public function draw(): void { $cx = 300; $cy = 300; $r = min($this->width, $this->height) / 2; $shapeSvg = match ($this->type) { 0 => "<circle cx='$cx' cy='$cy' r='$r' fill='#$this->color'/>", 1 => "<rect width='$this->width' height='$this->height' fill='$this->color'/>", 2 => "<ellipse cx='$cx' cy='$cy' rx ='$cx' ry='$cy' fill='$this->color' />", 3 => "<line x1='0' x2='$this->width' y1='0' y2='$this->height' stroke='$this->color' stroke-width='10'/>", }; echo "<svg width='500' height='500'> $shapeSvg </svg>"; }}
- Assistant
Для того чтобы увеличить фигуру в размерах и добавить надпись "Here was Ivan", можно внести следующие изменения в код:
class Decoder{ const TYPE_MASK = 0b11000000; const W_MASK = 0b00110000; const H_MASK = 0b00001100; const COL_MASK = 0b00000011; private int $type; private string $color; private int $width; private int $height; public function __construct($num) { $this->width = match (($num & self::W_MASK)>>4){ 0 => 40, 1 => 100, 2 => 200, 3 => 500 }; $this->height = match (($num & self::H_MASK)>>2){ 0 => 40, 1 => 100, 2 => 200, 3 => 500 }; $this->color = match ($num & self::COL_MASK){ 0 => '#000000', 1 => '#ff0000', 2 => '#00ff00', 3 => '#0000ff' }; $this->type = ($num & self::TYPE_MASK) >> 6; } public function draw(): void { $cx = 300; $cy = 300; $r = min(2 * $this->width, 2 * $this->height) / 2; $shapeSvg = match ($this->type) { 0 => "<circle cx='$cx' cy='$cy' r='$r' fill='#$this->color'/> <text x='$cx' y='$cy' dominant-baseline='middle' text-anchor='middle'>Here was Ivan</text>", 1 => "<rect width='$this->width' height='$this->height' fill='$this->color'/> <text x='$this->width' y='$this->height' dominant-baseline='hanging' text-anchor='start'>Here was Ivan</text>", 2 => "<ellipse cx='$cx' cy='$cy' rx ='$cx' ry='$cy' fill='$this->color' /> <text x='$cx' y='$cy' dominant-baseline='middle' text-anchor='middle'>Here was Ivan</text>", 3 => "<line x1='0' x2='$this->width' y1='0' y2='$this->height' stroke='$this->color' stroke-width='10'/> <text x='$this->width' y='$this->height' dominant-baseline='hanging' text-anchor='start'>Here was Ivan</text>", }; echo "<svg width='500' height='500'> $shapeSvg </svg>"; } }
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.