potrzebuje kodu svg do planszy do sudoku 6 i 9 zama tabela
- User
potrzebuje kodu svg do planszy do sudoku 6 i 9 zama tabela
Assistant
Cudownie! Oto kod SVG dla planszy do Sudoku w wersjach 6x6 oraz 9x9. Każda komórka jest reprezentowana przez grupę
<rect>(prostokąt) oraz<text>(tekst), gdzie będziesz mógł wpisywać liczby. Dodatkowo, dla estetyki i czytelności, dodałem nieco stylowania CSS bezpośrednio w SVG.Wersja 6x6:
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 360 360" width="360" height="360"> <style> rect { fill: #fff; stroke: #000; stroke-width: 2; } rect.thick-right { stroke-width: 4; } rect.thick-bottom { stroke-width: 4; } text { font-size: 24px; text-anchor: middle; dominant-baseline: middle; } </style> <!-- Rysowanie siatki 6x6 podzielonej na kwadraty 3x2 --> <rect x="0" y="0" width="360" height="360" fill="none" stroke="#000" stroke-width="4"/> <!-- Wiersze i kolumny --> <rect x="0" y="0" width="60" height="60"/><rect x="60" y="0" width="60" height="60" class="thick-right"/><rect x="120" y="0" width="60" height="60"/><rect x="180" y="0" width="60" height="60" class="thick-right"/><rect x="240" y="0" width="60" height="60"/><rect x="300" y="0" width="60" height="60"/> <rect x="0" y="60" width="60" height="60"/><rect x="60" y="60" width="60" height="60" class="thick-right"/><rect x="120" y="60" width="60" height="60"/><rect x="180" y="60" width="60" height="60" class="thick-right"/><rect x="240" y="60" width="60" height="60"/><rect x="300" y="60" width="60" height="60"/> <rect x="0" y="120" width="60" height="60" class="thick-bottom"/><rect x="60" y="120" width="60" height="60" class="thick-right thick-bottom"/><rect x="120" y="120" width="60" height="60" class="thick-bottom"/><rect x="180" y="120" width="60" height="60" class="thick-right thick-bottom"/><rect x="240" y="120" width="60" height="60" class="thick-bottom"/><rect x="300" y="120" width="60" height="60" class="thick-bottom"/> <rect x="0" y="180" width="60" height="60"/><rect x="60" y="180" width="60" height="60" class="thick-right"/><rect x="120" y="180" width="60" height="60"/><rect x="180" y="180" width="60" height="60" class="thick-right"/><rect x="240" y="180" width="60" height="60"/><rect x="300" y="180" width="60" height="60"/> <rect x="0" y="240" width="60" height="60"/><rect x="60" y="240" width="60" height="60" class="thick-right"/><rect x="120" y="240" width="60" height="60"/><rect x="180" y="240" width="60" height="60" class="thick-right"/><rect x="240" y="240" width="60" height="60"/><rect x="300" y="240" width="60" height="60"/> <rect x="0" y="300" width="60" height="60" class="thick-bottom"/><rect x="60" y="300" width="60" height="60" class="thick-right thick-bottom"/><rect x="120" y="300" width="60" height="60" class="thick-bottom"/><rect x="180" y="300" width="60" height="60" class="thick-right thick-bottom"/><rect x="240" y="300" width="60" height="60" class="thick-bottom"/><rect x="300" y="300" width="60" height="60" class="thick-bottom"/> <!-- Miejsca na wpisanie cyfr --> <text x="30" y="30"></text><text x="90" y="30"></text><text x="150" y="30"></text><text x="210" y="30"></text><text x="270" y="30"></text><text x="330" y="30"></text> <text x="30" y="90"></text><text x="90" y="90"></text><text x="150" y="90"></text><text x="210" y="90"></text><text x="270" y="90"></text><text x="330" y="90"></text> <text x="30" y="150"></text><text x="90" y="150"></text><text x="150" y="150"></text><text x="210" y="150"></text><text x="270" y="150"></text><text x="330" y="150"></text> <text x="30" y="210"></text><text x="90" y="210"></text><text x="150" y="210"></text><text x="210" y="210"></text><text x="270" y="210"></text><text x="330" y="210"></text> <text x="30" y="270"></text><text x="90" y="270"></text><text x="150" y="270"></text><text x="210" y="270"></text><text x="270" y="270"></text><text x="330" y="270"></text> <text x="30" y="330"></text><text x="90" y="330"></text><text x="150" y="330"></text><text x="210" y="330"></text><text x="270" y="330"></text><text x="330" y="330"></text> </svg>Wersja 9x9:
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 540 540" width="540" height="540"> <style> rect { fill: #fff; stroke: #000; stroke-width: 2; } rect.thick-right { stroke-width: 4; } rect.thick-bottom { stroke-width: 4; } text { font-size: 24px; text-anchor: middle; dominant-baseline: middle; } </style> <!-- Rysowanie siatki 9x9 podzielonej na kwadraty 3x3 --> <rect x="0" y="0" width="540" height="540" fill="none" stroke="#000" stroke-width="4"/> <!-- Wiersze i kolumny --> <rect x="0" y="0" width="60" height="60"/><rect x="60" y="0" width="60" height="60"/><rect x="120" y="0" width="60" height="60" class="thick-right"/><rect x="180" y="0" width="60" height="60"/><rect x="240" y="0" width="60" height="60"/><rect x="300" y="0" width="60" height="60" class="thick-right"/><rect x="360" y="0" width="60" height="60"/><rect x="420" y="0" width="60" height="60"/><rect x="480" y="0" width="60" height="60"/> <rect x="0" y="60" width="60" height="60"/><rect x="60" y="60" width="60" height="60"/><rect x="120" y="60" width="60" height="60" class="thick-right"/><rect x="180" y="60" width="60" height="60"/><rect x="240" y="60" width="60" height="60"/><rect x="300" y="60" width="60" height="60" class="thick-right"/><rect x="360" y="60" width="60" height="60"/><rect x="420" y="60" width="60" height="60"/><rect x="480" y="60" width="60" height="60"/> <rect x="0" y="120" width="60" height="60"/><rect x="60" y="120" width="60" height="60"/><rect x="120" y="120" width="60" height="60" class="thick-right thick-bottom"/><rect x="180" y="120" width="60" height="60"/><rect x="240" y="120" width="60" height="60"/><rect x="300" y="120" width="60" height="60" class="thick-right thick-bottom"/><rect x="360" y="120" width="60" height="60"/><rect x="420" y="120" width="60" height="60"/><rect x="480" y="120" width="60" height="60" class="thick-bottom"/> <rect x="0" y="180" width="60" height="60"/><rect x="60" y="180" width="60" height="60"/><rect x="120" y="180" width="60" height="60" class="thick-right"/><rect x="180" y="180" width="60" height="60"/><rect x="240" y="180" width="60" height="60"/><rect x="300" y="180" width="60" height="60" class="thick-right"/><rect x="360" y="180" width="60" height="60"/><rect x="420" y="180" width="60" height="60"/><rect x="480" y="180" width="60" height="60"/> <rect x="0" y="240" width="60" height="60"/><rect x="60" y="240" width="60" height="60"/><rect x="120" y="240" width="60" height="60" class="thick-right"/><rect x="180" y="240" width="60" height="60"/><rect x="240" y="240" width="60" height="60"/><rect x="300" y="240" width="60" height="60" class="thick-right"/><rect x="360" y="240" width="60" height="60"/><rect x="420" y="240" width="60" height="60"/><rect x="480" y="240" width="60" height="60"/> <rect x="0" y="300" width="60" height="60"/><rect x="60" y="300" width="60" height="60"/><rect x="120" y="300" width="60" height="60" class="thick-right thick-bottom"/><rect x="180" y="300" width="60" height="60"/><rect x="240" y="300" width="60" height="60"/><rect x="300" y="300" width="60" height="60" class="thick-right thick-bottom"/><rect x="360" y="300" width="60" height="60"/><rect x="420" y="300" width="60" height="60"/><rect x="480" y="300" width="60" height="60" class="thick-bottom"/> <rect x="0" y="360" width="60" height="60"/><rect x="60" y="360" width="60" height="60"/><rect x="120" y="360" width="60" height="60" class="thick-right"/><rect x="180" y="360" width="60" height="60"/><rect x="240" y="360" width="60" height="60"/><rect x="300" y="360" width="60" height="60" class="thick-right"/><rect x="360" y="360" width="60" height="60"/><rect x="420" y="360" width="60" height="60"/><rect x="480" y="360" width="60" height="60"/> <rect x="0" y="420" width="60" height="60"/><rect x="60" y="420" width="60" height="60"/><rect x="120" y="420" width="60" height="60" class="thick-right"/><rect x="180" y="420" width="60" height="60"/><rect x="240" y="420" width="60" height="60"/><rect x="300" y="420" width="60" height="60" class="thick-right"/><rect x="360" y="420" width="60" height="60"/><rect x="420" y="420" width="60" height="60"/><rect x="480" y="420" width="60" height="60"/> <rect x="0" y="480" width="60" height="60"/><rect x="60" y="480" width="60" height="60"/><rect x="120" y="480" width="60" height="60" class="thick-right thick-bottom"/><rect x="180" y="480" width="60" height="60"/><rect x="240" y="480" width="60" height="60"/><rect x="300" y="480" width="60" height="60" class="thick-right thick-bottom"/><rect x="360" y="480" width="60" height="60"/><rect x="420" y="480" width="60" height="60"/><rect x="480" y="480" width="60" height="60" class="thick-bottom"/> <!-- Miejsca na wpisanie cyfr --> <text x="30" y="30"></text><text x="90" y="30"></text><text x="150" y="30"></text><text x="210" y="30"></text><text x="270" y="30"></text><text x="330" y="30"></text><text x="390" y="30"></text><text x="450" y="30"></text><text x="510" y="30"></text> <text x="30" y="90"></text><text x="90" y="90"></text><text x="150" y="90"></text><text x="210" y="90"></text><text x="270" y="90"></text><text x="330" y="90"></text><text x="390" y="90"></text><text x="450" y="90"></text><text x="510" y="90"></text> <text x="30" y="150"></text><text x="90" y="150"></text><text x="150" y="150"></text><text x="210" y="150"></text><text x="270" y="150"></text><text x="330" y="150"></text><text x="390" y="150"></text><text x="450" y="150"></text><text x="510" y="150"></text> <text x="30" y="210"></text><text x="90" y="210"></text><text x="150" y="210"></text><text x="210" y="210"></text><text x="270" y="210"></text><text x="330" y="210"></text><text x="390" y="210"></text><text x="450" y="210"></text><text x="510" y="210"></text> <text x="30" y="270"></text><text x="90" y="270"></text><text x="150" y="270"></text><text x="210" y="270"></text><text x="270" y="270"></text><text x="330" y="270"></text><text x="390" y="270"></text><text x="450" y="270"></text><text x="510" y="270"></text> <text x="30" y="330"></text><text x="90" y="330"></text><text x="150" y="330"></text><text x="210" y="330"></text><text x="270" y="330"></text><text x="330" y="330"></text><text x="390" y="330"></text><text x="450" y="330"></text><text x="510" y="330"></text> <text x="30" y="390"></text><text x="90" y="390"></text><text x="150" y="390"></text><text x="210" y="390"></text><text x="270" y="390"></text><text x="330" y="390"></text><text x="390" y="390"></text><text x="450" y="390"></text><text x="510" y="390"></text> <text x="30" y="450"></text><text x="90" y="450"></text><text x="150" y="450"></text><text x="210" y="450"></text><text x="270" y="450"></text><text x="330" y="450"></text><text x="390" y="450"></text><text x="450" y="450"></text><text x="510" y="450"></text> <text x="30" y="510"></text><text x="90" y="510"></text><text x="150" y="510"></text><text x="210" y="510"></text><text x="270" y="510"></text><text x="330" y="510"></text><text x="390" y="510"></text><text x="450" y="510"></text><text x="510" y="510"></text> </svg>Wyjaśnienie:
- Struktura: Każdy kwadrat (komórka Sudoku) jest reprezentowany przez element
<rect>. Dodatkowo, pogrubione linie oddzielające większe kwadraty (3x2 w wersji 6x6 i 3x3 w wersji 9x9) są osiągnięte przez dodanie klasthick-rightithick-bottom, które zwiększająstroke-width. - Tekst: Elementy
<text>są pozycjonowane w środku każdej komórki. Ich współrzędnexiysą ustawione tak, aby tekst był wyśrodkowany (text-anchor: middle; dominant-baseline: middle;). - Stylowanie: CSS w SVG definiuje podstawowe style: białe wypełnienie komórek (
fill: #fff), czarne obramowania (stroke: #000), oraz rozmiar tekstu (font-size: 24px). - Wymiary:
- Wersja 6x6: Plansza ma 360x360 pikseli, każda komórka 60x60 pikseli.
- Wersja 9x9: Plansza ma 540x540 pikseli, każda komórka również 60x60 pikseli.
Jak edytować?
- Aby wpisać liczbę w komórce, po prostu dodaj ją wewnątrz odpowiedniego elementu
<text>. Przykład:<text x="30" y="30">5</text> - Jeśli chcesz zmienić rozmiar planszy, dostosuj atrybuty
width,heightorazviewBoxw tagu<svg>. - Kolory, grubości linii i inne style łatwo zmienisz w sekcji
<style>.
Miłej zabawy z Sudoku! 🎉
- Struktura: Każdy kwadrat (komórka Sudoku) jest reprezentowany przez element
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.