PageSourceSearch

https://logicpuzzles.ca/assets/PrintableTentsPage-078db3ce.js

js logicpuzzles.ca collected 2026-10-08 19:24:05 UTC 7,966 bytes, 2 lines download raw bytes

1import{j as l,a as e,r as c,H as $,N as D,L as k,t as j}from"./index-e83202b1.js";import{P as F}from"./PrintableExtras-04fc8f45.js";/* empty css                            */function L({puzzle:u,showSolution:w=!1,size:r="medium"}){const{size:n,trees:h,rowClues:S,colClues:d,answer:y}=u,z={};h.forEach(([i,a])=>{z[`${i}-${a}`]=!0});const b={};w&&y&&y.forEach(([i,a])=>{b[`${i}-${a}`]=!0});const s=(()=>r==="small"?n<=6?28:n<=8?24:20:r==="large"?n<=6?40:n<=8?35:30:n<=6?34:n<=8?30:26)();return l("div",{className:"printable-tents-grid",style:{display:"inline-block"},children:[e("div",{style:{display:"flex",marginLeft:s+4},children:d.map((i,a)=>e("div",{style:{width:s,height:20,display:"flex",alignItems:"center",justifyContent:"center",fontSize:12,fontWeight:"bold"},children:i},`col-${a}`))}),l("div",{style:{display:"flex"},children:[e("div",{style:{display:"flex",flexDirection:"column"},children:S.map((i,a)=>e("div",{style:{width:s,height:s,display:"flex",alignItems:"center",justifyContent:"center",fontSize:12,fontWeight:"bold"},children:i},`row-${a}`))}),e("div",{style:{display:"grid",gridTemplateColumns:`repeat(${n}, ${s}px)`,gridTemplateRows:`repeat(${n}, ${s}px)`,border:"2px solid #000",backgroundColor:"#fff"},children:Array(n).fill(null).map((i,a)=>Array(n).fill(null).map((C,T)=>{const g=`${a}-${T}`,v=z[g],t=b[g];return l("div",{style:{width:s,height:s,border:"1px solid #ccc",display:"flex",alignItems:"center",justifyContent:"center",fontSize:s*.6,fontWeight:"bold",backgroundColor:v?"#e8f5e9":"#fff"},children:[v&&e("span",{style:{color:"#2e7d32"},children:"T"}),t&&e("span",{style:{color:"#000"},children:"A"})]},g)}))})]})]})}const I=[{value:"all",label:"All Sizes"},{value:"6",label:"6x6"},{value:"8",label:"8x8"},{value:"10",label:"10x10"}],_=[4,6,8];function W(){const[u,w]=c.useState([]),[r,n]=c.useState([]),[h,S]=c.useState("all"),[d,y]=c.useState(4),[z,b]=c.useState(!0),[p,s]=c.useState(!0),[i,a]=c.useState(null),C=[1,2,3,4,5,6,7,8,9,10],T=async(t,o)=>{s(!0),a(null);try{const m=C.map(async N=>{try{const f=await fetch(`/dailylogicpuzzles/assets/assets/games/tents_and_trees/levels/${N}.json`);if(f.ok)return{...await f.json(),id:N}}catch{}return null});let P=(await Promise.all(m)).filter(Boolean);if(o!=="all"){const N=parseInt(o);P=P.filter(f=>f.size===N)}const E=[...P].sort(()=>Math.random()-.5).slice(0,t);n(E),w(P)}catch(m){a("Failed to load puzzles. Please try again."),console.error(m)}finally{s(!1)}};c.useEffect(()=>{window.__PRERENDER__||T(d,h)},[]);const g=c.useCallback(()=>{let t=u;if(h!=="all"){const m=parseInt(h);t=u.filter(x=>x.size===m)}const o=[...t].sort(()=>Math.random()-.5);n(o.slice(0,d))},[u,h,d]),v=()=>{j("tent-logic","print",{count:r.length}),window.print()};return l("div",{className:"printable-page",children:[l($,{children:[e("title",{children:"Free Printable Tent Logic Puzzles PDF | Camping Logic Puzzle Worksheets"}),e("meta",{name:"description",content:"Download free printable Tent Logic puzzles. PDF worksheets where you place tents next to trees. Perfect for classrooms, brain training, or offline puzzle solving."}),e("meta",{name:"keywords",content:"printable tent logic puzzle pdf, free camping puzzle, tent puzzle download, printable logic puzzles, campsite puzzle pdf"}),e("meta",{property:"og:title",content:"Free Printable Tent Logic Puzzles PDF | Logic Puzzles CA"}),e("meta",{property:"og:description",content:"Download free printable Tent Logic puzzles with solutions."}),e("link",{rel:"canonical",href:"https://logicpuzzles.ca/printable/tent-logic"})]}),e(D,{}),e("section",{className:"printable-hero",children:l("div",{className:"printable-hero-content",children:[e("span",{className:"eyebrow",children:"Free printable · PDF worksheets"}),e("h1",{children:"Free Printable Tent Logic Puzzles"}),e("p",{children:"Camping logic puzzles - Download PDF worksheets"})]})}),e("section",{className:"controls no-print",children:l("div",{className:"controls-container",children:[l("div",{className:"control-group",children:[e("label",{htmlFor:"gridSize",children:"Grid Size:"}),e("select",{id:"gridSize",value:h,onChange:t=>S(t.target.value),children:I.map(t=>e("option",{value:t.value,children:t.label},t.value))})]}),l("div",{className:"control-group",children:[e("label",{htmlFor:"puzzleCount",children:"Puzzles per Page:"}),e("select",{id:"puzzleCount",value:d,onChange:t=>y(parseInt(t.target.value)),children:_.map(t=>e("option",{value:t,children:t},t))})]}),e("div",{className:"control-group checkbox-group",children:l("label",{children:[e("input",{type:"checkbox",checked:z,onChange:t=>b(t.target.checked)}),"Include Solutions"]})}),l("div",{className:"control-buttons",children:[e("button",{className:"btn-secondary",onClick:g,disabled:p||u.length===0,children:"New Puzzles"}),e("button",{className:"btn-primary",onClick:v,disabled:r.length===0,children:"Print"})]})]})}),l("section",{className:"print-area",children:[p&&e("div",{className:"loading-message",children:e("p",{children:"Loading puzzles..."})}),i&&e("div",{className:"error-message",children:e("p",{children:i})}),!p&&!i&&r.length===0&&e("div",{className:"no-puzzles-message",children:e("p",{children:"No puzzles found for the selected size. Try a different option."})}),!p&&r.length>0&&l("div",{className:"puzzle-sheet",children:[e("h2",{className:"sheet-title",children:"Tent Logic Puzzles"}),e("p",{className:"sheet-subtitle",children:"logicpuzzles.ca - T = Tree, A = Tent (Answer)"}),e("div",{className:"puzzles-grid","data-count":d,children:r.map((t,o)=>l("div",{className:"puzzle-item",children:[l("p",{className:"puzzle-label",children:["Puzzle ",o+1," (",t.size,"x",t.size,")"]}),e(L,{puzzle:t,showSolution:!1})]},`puzzle-${o}`))})]}),!p&&z&&r.length>0&&l("div",{className:"puzzle-sheet solutions-sheet",children:[e("h2",{className:"sheet-title",children:"Solutions"}),e("p",{className:"sheet-subtitle",children:"logicpuzzles.ca"}),e("div",{className:"puzzles-grid solutions-grid","data-count":d,children:r.map((t,o)=>l("div",{className:"puzzle-item solution-item",children:[l("p",{className:"puzzle-label",children:["#",o+1]}),e(L,{puzzle:t,showSolution:!0,size:"small"})]},`solution-${o}`))})]})]}),e(F,{slug:"tent-logic"}),e("section",{className:"seo-content no-print",children:l("div",{className:"seo-container",children:[e("h2",{children:"About Tent Logic Puzzles"}),l("p",{children:[e("strong",{children:"Tent Logic"})," is a camping logic puzzle where you place tents in a grid. Each tree must have exactly one tent directly adjacent (horizontally or vertically), and tents cannot touch each other, even diagonally. The numbers along the edges tell you how many tents are in each row and column."]}),e("h3",{children:"How to Solve Tent Logic"}),l("ul",{children:[l("li",{children:[e("strong",{children:"One Tent Per Tree:"})," Each tree has exactly one tent next to it (up, down, left, or right)."]}),l("li",{children:[e("strong",{children:"No Touching Tents:"})," Tents cannot be adjacent to each other, even diagonally."]}),l("li",{children:[e("strong",{children:"Row/Column Clues:"})," Numbers show how many tents must be in that line."]}),l("li",{children:[e("strong",{children:"Elimination:"})," If a row's clue is 0, mark all cells in that row as grass (empty)."]})]}),e("h3",{children:"Legend"}),l("ul",{children:[l("li",{children:[e("strong",{children:"T (green):"})," Tree - tents must be placed adjacent to trees."]}),l("li",{children:[e("strong",{children:"A:"})," Tent placement in solutions."]})]}),l("div",{className:"cta-section",children:[e("h3",{children:"Play More Logic Puzzles Online"}),e("p",{children:"Enjoy interactive solving with hints, undo, and progress tracking."}),l("div",{className:"cta-buttons",children:[e(k,{to:"/play/dailylogicpuzzles",className:"btn-primary",children:"Play Daily Logic Puzzles"}),e(k,{to:"/logic-games",className:"btn-secondary",children:"More Logic Games"})]})]})]})})]})}export{W as default};
2//# sourceMappingURL=PrintableTentsPage-078db3ce.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.