This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
KingofGamesYami's profile picture

[Teletext Characters] Infinity Loop CC -- Now With 100% More Menus!

Started by KingofGamesYami, 10 August 2016 - 11:26 PM
KingofGamesYami #1
Posted 11 August 2016 - 01:26 AM
This is my port of infinity loop to ComputerCraft. It's a simple puzzle game with one objective - tie up all the ends, creating one or more infinite loops.
The program features the game itself as well as an editor. To aquire it, simply run:
pastebin get SFuBaAKT infloop
Editor:
After selecting the file to edit, use 'q' to save & quit, or 'r' to randomize the direction of the tiles. Right & Left click cycle through tiles.
I encourage you to send a PR with your files to my github repository, which can be downloaded by anyone.
New! Use 'c' to choose foreground and background colors! (foreground prompts first)
Main Game:
Use right or left click to rotate a tile
Credits:
nitrogenfingers for his excellent micropaint program
CoderPuppy for beta-testing
∞ Infinity Games for creating the original game (I've played more than 1000 levels!)
ElvishJerricco for his json API
Versions:
1.1 - Added a menu, including an option to download levels from github
1.2 - Added custom color support
1.25 - Fixed color changing in the editor
1.5 - Added solve.lua support (download, solve, and generate random)
This program uses my minimenu and menu to provide a UI.
Edited on 18 August 2016 - 06:37 PM
Bomb Bloke #2
Posted 11 August 2016 - 03:49 AM
Plays well enough, but do you intend to extend it? It could use a bit more in the way of "interface". Certainly a random level generator would make it a lot more "playable".

Because I'm not very creative I copied a couple of levels out of the android version's screenshots.

Spoiler
00000000000000000
00000000000000000
00007704208400000
00036115b9c000000
00045318b9e000000
00007601307300000
00000000000000000
00000000000000000
00000000000000000
00000000000000000
00000000000000000
00000008800000000
00000088880000000
00000088880000000
00000088880000000
00000088880000000
00000008800000000
00000000000000000
nitrogenfingers #3
Posted 11 August 2016 - 04:41 AM
This is really cool, but it definitely needs more content. A few interface niceties wouldn't go astray either- maybe a level folder and an in-game menu rather than providing a path by command line.

Also could you change line 297 to be draw( shell.resolve(tArgs[1])) or similar?
KingofGamesYami #4
Posted 11 August 2016 - 02:37 PM
I do indeed intend to work on this quite a bit more - this is mostly what I wrote while on vacation, with no internet and no testing environment (chromebooks suck). I bugfixed and added the tile graphics yesterday.
KingofGamesYami #5
Posted 11 August 2016 - 10:24 PM
Update - I've now added a menu, along with an option to download levels from github. The levels are stored in their own directory.
Plays well enough, but do you intend to extend it? It could use a bit more in the way of "interface". Certainly a random level generator would make it a lot more "playable".
Because I'm not very creative I copied a couple of levels out of the android version's screenshots.
-snip-

I'll look into a random level generator, and I've added the levels you created to the github repository - PM me if you would like them removed.
Bomb Bloke #6
Posted 13 August 2016 - 01:34 PM
As I said, they're not my levels. ;)/>

Another suggestion you may or may not be interested in - random colour schemes. Say brown on red, or purple on blue, grey on lightGrey, and so on; just pick a different combination with each puzzle. It's a minor thing, but I reckon it'd do a lot for the "feel" of the game.
KingofGamesYami #7
Posted 13 August 2016 - 04:27 PM
As I said, they're not my levels. ;)/>
Another suggestion you may or may not be interested in - random colour schemes. Say brown on red, or purple on blue, grey on lightGrey, and so on; just pick a different combination with each puzzle. It's a minor thing, but I reckon it'd do a lot for the "feel" of the game.

I know they aren't "yours", but I'm too lazy to figure out which levels they are - it's easier to just stick any levels submitted by a given person in their folder.

I've thought about random color schemes, but I'm unsure if I should do a random one every time you play a level, or if I should tie a color scheme to a level permanently. The former would certainly be easier, but the latter is closer to the behavior of the actual game.
supernicejohn #8
Posted 13 August 2016 - 10:02 PM
Ok, I don't understand github, but I made two very difficult levels, both tested of course.
1:

00000000000000000
00000000000000000
008b529184499e9e4
00998a55caba86788
0097976c8b88c6769
00babfceebac9f9f7
009857fbc669893f1
006caa868572eb9e2
00000000000000000
2:

858dae62889645597
5ffc4a698e7cb5147
56db9beaa6a2dc848
87b67deaabb8b6bbb
398bb4758dd7d2985
7716d52c86f4dbd51
27521e7a1bc3b9bb7
ce6e76efe85618829
546d86263315aaae8
Nice game, and I agree that colors would be a good idea!
H4X0RZ #9
Posted 13 August 2016 - 11:39 PM
As I said, they're not my levels. ;)/>/>
Another suggestion you may or may not be interested in - random colour schemes. Say brown on red, or purple on blue, grey on lightGrey, and so on; just pick a different combination with each puzzle. It's a minor thing, but I reckon it'd do a lot for the "feel" of the game.

I know they aren't "yours", but I'm too lazy to figure out which levels they are - it's easier to just stick any levels submitted by a given person in their folder.

I've thought about random color schemes, but I'm unsure if I should do a random one every time you play a level, or if I should tie a color scheme to a level permanently. The former would certainly be easier, but the latter is closer to the behavior of the actual game.

Maybe just add the scheme to the level format (at the top/bottom) as a separate line?
KingofGamesYami #10
Posted 14 August 2016 - 01:35 AM
Ok, I don't understand github, but I made two very difficult levels, both tested of course.
-snip-
Nice game, and I agree that colors would be a good idea!

I've added them to github myself, although it's really quite easy. Just fork the repo and make changes, then send a Pull Request with those changes to my repo.

Thanks, I'll definitely be looking into colors some more.

-snip-
Maybe just add the scheme to the level format (at the top/bottom) as a separate line?

Seems like a good way to handle things, I'll do it. Probably add it to the bottom, so I don't have to update the current level files.
KingofGamesYami #11
Posted 14 August 2016 - 03:04 AM
1.2 has been released! Color is now supported, you can press 'c' in the level editor to change the colors.

Known Bugs
-Colors do not update after selecting them in the editor (this will be fixed in 1.25)


1.25 released! Colors now change properly in the editor!
Edited on 14 August 2016 - 11:58 AM
CoderPuppy #12
Posted 14 August 2016 - 10:04 PM
I wrote a level solver and generator

source: https://github.com/CoderPuppy/ilcc-solver

here's it solving supernicejohn's second level:


and generating a 10x10 level:
supernicejohn #13
Posted 14 August 2016 - 10:20 PM
How even.
I wrote a level solver and generator

source: https://github.com/C...ppy/ilcc-solver
That's. Yeah.
CoderPuppy #14
Posted 14 August 2016 - 10:42 PM
How even.

It starts with knowing that there can't be connections on the edge
Then it repeatedly for each active tile (propagates from the sides) finds all the possible variants (a.k.a. rotations) given which connections must exist and which must not and figures out which connections are in all the variants and which are in none and applies that data (affecting neighboring tiles and making them active)

That works for some levels but not for supernicejohn/1, supernicejohn/2 and BombBloke/1 in which there are ambiguous areas, there it uses the first possible variant for one of the unknown tiles and continues.
It might be possible to create a level where doing that won't work (where choosing one of the possibilities will make it impossible to complete) but I wasn't able to create one so that's not fully implemented yet.
supernicejohn #15
Posted 14 August 2016 - 10:51 PM
Huh. I thought that this type of puzzle was difficult enough that (other than bruteforcing) only the outer edges could be solved.
I'll dig through your code and see if I can understand how it does the second part.
Also the third part, I thought that it really wouldn't work to do that. I've sometimes gotten two unfinished ones one opposite sides of the puzzle, but maybe that can be completely solved with the iterative approach. I don't know. But a Good Job to you!

Now to prove that last part mathematically. =P
KingofGamesYami #16
Posted 18 August 2016 - 03:25 PM
I have created a build which implements CoderPuppy's solve.lua, but I'm waiting on this issue to be resolved before I release it.
KingofGamesYami #17
Posted 18 August 2016 - 08:37 PM
Version 1.5 Released! Added support for CoderPuppy's solve.lua