Leaderboard
Popular Content
Showing content with the highest reputation on 10/10/2024 in all areas
-
I saw an interesting math problem. A group of mice find a round cheese and start eating it. At first, they spread evenly around the perimeter of the cheese and start eating at the same time, at the same speed. The first mouse will advance in the direction of the second, the second mouse will advance in the direction of the third, ...the last mouse will advance in the direction of the first. Draw the cheese after the mice meet. Here are my cheeses eaten by 3, 5 and 10 mice. And here is the Lisp I wrote. (defun c:cheese() (setq mice 10 micePoz nil ang1 (/ PI 0.5 mice) ang 0 R 100.0 seg 0.1 continue T) (entmake (list (cons 0 "CIRCLE") (list 10 0.0 0.0) (cons 40 R) (cons 62 2))) (repeat mice (setq micePoz (cons (list (* R (sin (setq ang (+ ang ang1)))) (* R (cos ang))) micePoz)) ) (While continue (setq i -1 nextPoz nil) (repeat mice (setq i (1+ i) j (rem (1+ i) mice)) (setq m1 (nth i micePoz) m2 (nth J micePoz) dist (distance m1 m2) p (/ seg dist)) (setq nextPoz (cons (list (+ (car m1) (* p (- (car m2) (car m1)))) (+ (cadr m1) (* p (- (cadr m2) (cadr m1))))) nextPoz)) ) (setq nextPoz (reverse nextPoz) i -1) (repeat mice (entmake (list (cons 0 "LINE") (cons 10 (nth (setq i (1+ i)) micePoz)) (cons 11 (nth i nextPoz)) (cons 62 (+ 3 (* i 1))))) ) (setq micePoz nextPoz nextPoz nil) (setq continue (> dist (* 1 seg))) ) ) Finally, here's a mouse looking for the next cheese. (defun c:mouse() (setq db (list -5.5 -0.15 1.0 3.8 5.9 -5.3 -2.0 1.6 1.1 2.3 -20.8 -18.4 19.3 1.0 1.3 -19.2 -8.9 11.4 0.7 1.1 -30.2 -16.6 25.2 0.7 0.8 -5.1 -17.9 14.2 1.4 1.7 11.8 -68.0 69.2 1.8 1.88 39.3 -121.0 127.0 1.9 1.9 -2.4 1.6 2.5 5.9 0.6 0.6 3.6 1.2 2.5 3.7 2.7 2.2 3.8 2.1 2.5 12.0 -225.6 226.7 1.6 1.6 13.4 -3.4 4.6 1.1 1.6 15.6 1.3 0.6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.4 -9.4 1.3 1.6 2.8 -0.6 -9.1 0.27 2.8 4.8 -0.6 -8.7 0.7 4.8 5.4 1.2 -9.8 1.5 2.1 2.7 0.3 -9.4 0.4 2.7 5.3 -1.1 -7.4 2.9 5.3 5.6 2.4 -9.45 1.2 2.2 3.3 1.5 -9.67 0.4 3.2 6.2 2.9 -9.6 1.0 2.2 3.2 2.5 -9.0 0.3 6.0 2.2 2.9 -9.1 0.2 2.9 0.3 5.4 -8.5 2.4 1.9 3.4 2.9 -2.0 4.6 5.1 0.56 0.8 3.1 3.0 4.6 5.9 -2.3 4.5 6.4 5.8 0.1 2.4 4.7 1.7 0.1 1.9 6.3 -6.7 13.8 1.9 2.1 0.0 3.1 2.2 2.1 2.7 -11.7 -3.86 1.5 5.5 1.0 4.6 0.3 6.1 4.8 1.8) ) (setq i 0) (repeat 82 (entmake (list (cons 0 "ARC") (list 10 (nth i db) (nth (1+ i) db)) (cons 40 (nth (+ 2 i) db)) (cons 50 (nth (+ 3 i) db)) (cons 51 (nth (+ 4 i) db)))) (setq i (+ 5 i)) ) ) Do you have other solutions for this cheese problem?2 points
-
that was is a galaxy far far away , when my hair wasn't turning gray yet ... I actually totally forgotten about this one hahaha , thanx for reminding me good thing about dementia is I can watch Star Trek over and over again https://www.cadtutor.net/forum/topic/65061-happy-easter/#comment-5361012 points
-
I had a 'system manager' who 'You name it I block it' ... needless to say that dragons don't respond well to this. So everytime he blocked something , I found another way. But this only worked fo so long , only to find out one of my colleagues ratted my out every single time. So I hid some code that could recognise the user and if it found out it was it was Judas it appended his acad.lsp with a princ '\nyou're running illegal software' so after a while he first had to go through multiple screens of these lines before he could do anything. (ok , bad bad dragon , but in self defence , I was younger then and I hate rats, they really taste bad)1 point
-
Someone has an auto running LISP - every 21st April up it pops and they forget to remove it till they get reminded the next year.... A lesson on locking your keyboard!1 point
-
I've never seem the cheese puzzle but am blatantly stealing the mouse! The best I had so far is a rabbit, lost the link years ago but was a cadtutor post (defun c:happy_easter ( / vlist fn fp tmp-dcl xim yim) ;;( X1, Y1, X2, Y2, colour) (setq vlist '( (223 125 216 128 4) (223 116 223 125 4) (210 116 223 116 4) (210 141 210 116 4) (223 131 216 128 4) (223 141 223 131 4) (216 128 210 128 4) (191 128 204 128 4) (191 141 204 141 4) (191 116 191 141 4) (204 116 191 116 4) (179 141 179 116 4) (173 116 185 116 4) (154 116 166 116 4) (154 125 154 116 4) (166 131 154 125 4) (166 141 166 131 4) (166 141 154 141 4) (135 128 148 128 4) (141 116 148 141 4) (135 141 141 116 4) (116 128 129 128 4) (116 141 129 141 4) (116 116 116 141 4) (129 116 116 116 4) (198 97 198 110 1) (198 97 204 85 1) (191 85 198 97 1) (185 97 173 97 1) (185 85 185 97 1) (166 85 154 85 1) (173 110 173 85 1) (166 97 154 97 1) (166 85 166 97 1) (185 85 173 85 1) (154 110 154 85 1) (135 97 148 97 1) (141 85 148 110 1) (135 110 141 85 1) (129 85 129 110 1) (116 97 129 97 1) (116 110 116 85 1) (276 491 275 503 2) (275 477 276 491 2) (273 461 275 477 2) (270 450 273 461 2) (267 437 270 450 2) (262 419 267 437 2) (256 404 262 419 2) (251 394 256 404 2) (234 379 229 368 2) (242 386 234 379 2) (251 394 242 386 2) (266 394 251 394 2) (280 393 266 394 2) (290 388 280 393 2) (297 380 290 388 2) (166 392 164 398 2) (170 387 166 392 2) (171 383 170 387 2) (174 354 171 360 2) (177 349 174 354 2) (181 346 177 349 2) (189 337 186 333 2) (194 344 189 337 2) (197 350 194 344 2) (197 355 197 350 2) (199 331 206 342 2) (338 465 331 468 2) (343 460 338 465 2) (347 455 343 460 2) (348 449 347 455 2) (348 442 348 449 2) (356 457 353 464 2) (358 448 356 457 2) (359 439 358 448 2) (360 415 357 423 2) (361 407 360 415 2) (361 400 361 407 2) (352 393 358 392 2) (347 395 352 393 2) (343 399 347 395 2) (338 404 343 399 2) (340 389 335 394 2) (346 386 340 389 2) (353 385 346 386 2) (290 259 293 258 2) (286 259 290 259 2) (282 261 286 259 2) (277 264 282 261 2) (272 267 277 264 2) (268 270 272 267 2) (263 274 268 270 2) (258 279 263 274 2) (254 284 258 279 2) (250 289 254 284 2) (246 295 250 289 2) (243 301 246 295 2) (239 309 243 301 2) (236 317 239 309 2) (233 323 236 317 2) (305 300 303 298 2) (307 303 305 300 2) (307 309 307 303 2) (311 301 307 309 2) (315 294 311 301 2) (316 285 315 294 2) (315 274 316 285 2) (314 266 315 274 2) (315 259 314 266 2) (299 263 293 258 2) (307 263 299 263 2) (315 259 307 263 2) (323 259 315 259 2) (327 154 331 154 2) (325 159 327 154 2) (325 164 325 159 2) (327 168 325 164 2) (329 169 327 168 2) (333 167 329 169 2) (298 221 299 217 2) (297 226 298 221 2) (297 234 297 226 2) (299 239 297 234 2) (304 240 299 239 2) (309 239 304 240 2) (313 236 309 239 2) (318 228 313 236 2) (323 222 318 228 2) (337 228 344 226 2) (334 230 337 228 2) (332 235 334 230 2) (328 238 332 235 2) (325 242 328 238 2) (321 247 325 242 2) (315 251 321 247 2) (310 254 315 251 2) (304 254 310 254 2) (298 253 304 254 2) (295 250 298 253 2) (294 246 295 250 2) (290 236 294 246 2) (288 228 290 236 2) (286 218 288 228 2) (285 210 286 218 2) (280 203 285 210 2) (286 207 280 203 2) (292 210 286 207 2) (299 213 292 210 2) (303 212 299 213 2) (308 215 303 212 2) (310 221 308 215 2) (312 218 310 221 2) (321 220 312 218 2) (328 225 321 220 2) (335 226 328 225 2) (344 226 335 226 2) (304 201 304 200 2) (305 201 304 201 2) (307 199 305 201 2) (304 198 307 199 2) (302 199 304 198 2) (302 202 302 199 2) (305 202 302 202 2) (308 200 305 202 2) (309 197 308 200 2) (306 195 309 197 2) (301 197 306 195 2) (299 202 301 197 2) (302 205 299 202 2) (305 205 302 205 2) (309 201 305 205 2) (312 196 309 201 2) (314 188 312 196 2) (315 182 314 188 2) (315 175 315 182 2) (314 170 315 175 2) (312 169 314 170 2) (308 169 312 169 2) (304 172 308 169 2) (299 177 304 172 2) (297 184 299 177 2) (295 190 297 184 2) (295 197 295 190 2) (328 207 328 210 2) (329 207 328 207 2) (329 212 329 207 2) (326 212 329 212 2) (326 208 326 212 2) (328 202 326 208 2) (331 206 328 202 2) (331 213 331 206 2) (323 214 331 213 2) (324 209 323 214 2) (327 200 324 209 2) (330 193 327 200 2) (334 186 330 193 2) (339 180 334 186 2) (344 177 339 180 2) (349 177 344 177 2) (351 179 349 177 2) (352 186 351 179 2) (351 192 352 186 2) (350 199 351 192 2) (347 206 350 199 2) (343 211 347 206 2) (293 192 278 186 2) (297 200 293 192 2) (304 210 297 200 2) (310 216 304 210 2) (319 217 310 216 2) (333 214 319 217 2) (346 210 333 214 2) (366 210 346 210 2) (338 152 321 154 2) (345 155 355 168 2) (408 531 409 525 2) (404 536 408 531 2) (398 542 404 536 2) (385 549 398 542 2) (368 553 385 549 2) (351 555 368 553 2) (333 555 351 555 2) (315 551 333 555 2) (298 539 315 551 2) (287 529 298 539 2) (278 516 287 529 2) (275 503 278 516 2) (248 522 275 503 2) (231 531 248 522 2) (212 538 231 531 2) (200 540 212 538 2) (183 541 200 540 2) (170 539 183 541 2) (161 535 170 539 2) (156 531 161 535 2) (154 526 156 531 2) (155 505 154 526 2) (157 500 155 505 2) (171 487 157 500 2) (181 482 171 487 2) (191 480 181 482 2) (234 479 191 480 2) (245 478 234 479 2) (254 474 245 478 2) (256 470 254 474 2) (256 463 256 470 2) (255 454 256 463 2) (248 437 255 454 2) (241 420 248 437 2) (235 406 241 420 2) (230 390 235 406 2) (229 373 230 390 2) (229 359 229 373 2) (230 342 229 359 2) (233 323 230 342 2) (226 326 233 323 2) (213 335 226 326 2) (206 342 213 335 2) (205 349 206 342 2) (201 352 205 349 2) (197 355 201 352 2) (195 366 197 355 2) (186 382 195 366 2) (180 395 186 382 2) (179 406 180 395 2) (183 417 179 406 2) (179 424 183 417 2) (172 424 179 424 2) (168 421 172 424 2) (164 411 168 421 2) (164 398 164 411 2) (161 392 164 398 2) (160 381 161 392 2) (158 379 160 381 2) (159 366 158 379 2) (161 356 159 366 2) (165 347 161 356 2) (165 338 165 347 2) (164 332 165 338 2) (161 327 164 332 2) (159 323 161 327 2) (158 315 159 323 2) (160 309 158 315 2) (165 306 160 309 2) (169 306 165 306 2) (173 309 169 306 2) (176 316 173 309 2) (177 325 176 316 2) (180 330 177 325 2) (186 333 180 330 2) (192 330 186 333 2) (199 331 192 330 2) (203 323 199 331 2) (215 305 203 323 2) (232 292 215 305 2) (243 280 232 292 2) (262 262 243 280 2) (274 255 262 262 2) (284 255 274 255 2) (293 258 284 255 2) (257 216 293 258 2) (253 206 257 216 2) (254 195 253 206 2) (259 188 254 195 2) (266 185 259 188 2) (278 186 266 185 2) (283 183 278 186 2) (293 175 283 183 2) (301 168 293 175 2) (314 160 301 168 2) (321 154 314 160 2) (309 131 321 154 2) (295 107 309 131 2) (289 92 295 107 2) (285 82 289 92 2) (285 51 285 82 2) (287 44 285 51 2) (292 33 287 44 2) (297 29 292 33 2) (300 31 297 29 2) (303 40 300 31 2) (307 53 303 40 2) (312 64 307 53 2) (330 89 312 64 2) (338 109 330 89 2) (339 121 338 109 2) (339 137 339 121 2) (338 152 339 137 2) (345 155 338 152 2) (351 144 345 155 2) (353 131 351 144 2) (355 91 353 131 2) (358 78 355 91 2) (362 63 358 78 2) (370 50 362 63 2) (381 39 370 50 2) (392 30 381 39 2) (398 29 392 30 2) (402 31 398 29 2) (401 37 402 31 2) (396 46 401 37 2) (392 60 396 46 2) (391 75 392 60 2) (390 95 391 75 2) (389 116 390 95 2) (386 130 389 116 2) (379 144 386 130 2) (367 157 379 144 2) (355 168 367 157 2) (355 179 355 168 2) (359 190 355 179 2) (364 206 359 190 2) (368 213 364 206 2) (373 219 368 213 2) (376 225 373 219 2) (376 231 376 225 2) (372 239 376 231 2) (364 246 372 239 2) (348 251 364 246 2) (334 256 348 251 2) (323 259 334 256 2) (326 261 323 259 2) (331 270 326 261 2) (335 281 331 270 2) (337 315 335 281 2) (348 343 337 315 2) (352 356 348 343 2) (352 382 352 356 2) (355 389 352 382 2) (358 392 355 389 2) (366 388 358 392 2) (376 387 366 388 2) (384 382 376 387 2) (388 375 384 382 2) (391 367 388 375 2) (396 361 391 367 2) (402 361 396 361 2) (406 368 402 361 2) (407 376 406 368 2) (404 385 407 376 2) (399 391 404 385 2) (389 396 399 391 2) (381 401 389 396 2) (376 408 381 401 2) (373 422 376 408 2) (371 439 373 422 2) (365 449 371 439 2) (349 469 365 449 2) (341 477 349 469 2) (335 478 341 477 2) (332 473 335 478 2) (331 465 332 473 2) (330 458 331 465 2) (333 448 330 458 2) (337 435 333 448 2) (336 418 337 435 2) (338 404 336 418 2) (335 402 338 404 2) (335 395 335 402 2) (335 388 335 395 2) (330 373 335 388 2) (326 359 330 373 2) (320 339 326 359 2) (310 314 320 339 2) (307 309 310 314 2) (297 319 307 309 2) (291 330 297 319 2) (288 343 291 330 2) (291 355 288 343 2) (297 380 291 355 2) (295 417 297 380 2) (296 463 295 417 2) (299 478 296 463 2) (305 487 299 478 2) (315 493 305 487 2) (330 496 315 493 2) (371 498 330 496 2) (381 501 371 498 2) (400 515 381 501 2) (409 525 400 515 2)) ) (setq fp (open (setq fn (vl-filename-mktemp ".dcl")) "w")) (write-line "im:dialog{label=\"Happy easter!\"; :image_button{key=\"im\";color=-2;width=100;aspect_ratio=1;allow_accept=true;is_default=true;}}" fp) (close fp)(gc) (setq tmp-dcl (load_dialog fn)) (new_dialog "im" tmp-dcl) (setq xim (dimx_tile "im") yim (dimy_tile "im")) (start_image "im") (fill_image 0 0 xim yim 0) (foreach x vlist (vl-catch-all-apply 'vector_image x)) (end_image) (action_tile "im" "(done_dialog 1)") (start_dialog) (if tmp-dcl (unload_dialog tmp-dcl)) (if (and fn (findfile fn)) (vl-file-delete fn)) )1 point
-
@Danielm103 Just a comment "Create room 110 at X * Y using room 109 as a template." I do have a lisp called floor planner, it draws rectangs with an offset of the stud wall thickness. You can then use it to draw internal and external walls. Helps working out room sizes can see problems straight away.1 point