Algorithm for choosing the best seats in a cinema. Made in dart.

Overview

Buy movie tickets algorithm

This dart project contains an algorithm to choose the better seats on the cinema. Also contains a bot to buy movie tickets on this page using this algorithm.

Algorithm

The algorithm is on lib/algorithm.dart. The algorithm is based on close clusters, since in some cinemas the seats are already separated by a seat (as a health precaution), so getting close clusters as results is also a valid answer. This proposal also works in cinemas where all seats are available.

The user's preferred row is an input; the algorithm will start in this row. In the row it will find the cluster closest to the center of the room and it will be taken as valid if it does not exceed the distance given by the user as input. If is not valid it goes to the next row, if is valid gets the distance to the other clusters in the row and classifies them as valid if they do not exceed one distance given by user as input. All valid ones join with the central cluster and the process is repeated until there are enough seats to cover those required by the user.

TODO (open to contributions)

  • In the case that no valid cluster is found, the distances to the center should be obtained of all clusters and choose all those that are close to 0. In this case there are no longer seats together, then the best clusters in the room are bought regardless of whether they are together.

Bot

The bot has two main parts: Finding the movie and buying the tickets.

In the part of finding the movie, you give to the bot some keys of the title of the movie you want to find. The bot looks for the movie, if it can't find it, it refreshes the screen. When he finds it, he goes to the purchase tickets part. This part was used to buy pre-sale tickets (where the movie appeared at midnight).

The part of buying tickets, navigates through the interface choosing the time and the type of seat. When choosing the seats, it crawls the map of the room and passes it to the algorithm that returns the right seats. The bot chooses the seats and continues browsing until the moment of purchase.

TODO (open to contributions)

  • Divide each navigation (page) so that when there is an error it only have to refresh the page and start from that part, don't restart the whole bot completely (current).
  • Along with the previous point, have a better error handling and improve the bot so that it supports page outage or slow page loads.

Use

The bot uses puppeteer to navigate in the page, so in the first run it will download a version of chromium in the repository root (.local-chromium /), so in the first execution it may take time.

To run it you need to have dart installed and run this command:

dart bin/cine_ticket_bot.dar
You might also like...

Mobile app made for FBLA in Dart with Flutter.

flutter_application_1 (name undecided) A companion app for students (mainly high school ones) to help them throughout the day. Getting Started This pr

Oct 7, 2022

A Dart library for creating a Dart object to represent directory trees.

Directory Tree A Dart library for creating a Dart object to represent directory trees. Getting Started Import and initialize package import 'package:d

Dec 1, 2021

A collection of Dart code samples by Dart DevRel

Dart samples A collection of Dart programs that illustrate features and best practices. For a list of community-maintained projects, see Awesome Dart.

Dec 30, 2022

A beer tracking app made with Flutter

A beer tracking app made with Flutter

Beer Me Up Beer Me Up is an iOS and Android app build with Flutter. The app is a personal beer logging that allows you to enter every beer you have to

Jan 5, 2023

An app for orientation week at Trinity College, University of Toronto. Made with Flutter

An app for orientation week at Trinity College, University of Toronto. Made with Flutter

Trinity Orientation 2018 An app created for Trinity College at University of Toronto. The app is acts as a companion for all first year students durin

Dec 30, 2022

Music App made with flutter

Music App made with flutter

Chillify A Flutter music app made with Provider and BLoC pattern. (Works on Android for now) Recommended Flutter version: 1.7.8+hotfix.4 UI heavily in

Jan 4, 2023

A Food Ordering App made with Flutter, node and using MySQL Database

A Food Ordering App made with Flutter, node and using MySQL Database

Flutter Food ordering App We have made a food ordering system. It will help the restaurant to do all the functionalities more accurately and in a fast

Dec 26, 2022

The worst launcher I made.

 The worst launcher I made.

The worst launcher I made. Known issues: The list of apps is not updated live The app does not ask for storage access, which makes the app load endles

Jul 15, 2022

Project created to replicate design made by DesignSense 😎

Project created to replicate design made by DesignSense 😎

☀️ Weather App ❄️ Project created to replicate design made by DesignSense 😎 . Demo: Packages used: flutter_svg: ^0.22.0 sleek_circular_slider: ^2.0.1

Dec 21, 2022
Owner
Chris Chávez
Chris Chávez
Dart package to rank proposals according to Majority Judgment, using a score-based algorithm for performance and scalability

Majority Judgment for Dart This Dart package helps to resolve polls using Majority Judgment. Features Efficient Majority Judgment algorithm, scales we

Mieux Voter 1 Oct 18, 2021
Algorithm Toolbox is an Android app for C++, Python and DART algorithms. It shows the codes as well as its explanation with various examples.

AlgoKing Algorithm Toolbox is an Android app for C++, Python and DART algorithms. It shows the codes as well as its explanation with various examples.

Hash Studios 5 Sep 13, 2022
AES 256 GCM encryption algorithm in Dart

aes-256-gcm-dart AES 256 GCM encryption algorithm in Dart Use var text = 'SOME D

Swifty 8 Nov 11, 2022
Dart library with stack blur algorithm for RGBA images

stack_blur The Dart library for blurring images with the Stack blur algorithm. T

Artёm IG 3 Nov 19, 2022
A Flutter ListView that implicitly calculates the changes between two lists using the MyersDiff algorithm and animates between them for you

A Flutter ListView that implicitly calculates the changes between two lists using the MyersDiff algorithm and animates between them for you

Vojtech Pavlovsky 2 Dec 16, 2022
Best ever drawer in flutter for android and ios

Drawer in Flutter Best ever drawer in flutter to make precious application. This flutter app is made just to demonstrate how you we can make an animat

Asad Malik 22 Oct 16, 2022
a sample flutter app using Injection, routing and simple authentication follows clean code and best practices

Flutter Clean Project A sample flutter app using Injection, routing and simple authentication follows clean code and best practices Features Cleaned f

Moez Shakeri 12 Jan 2, 2023
News Adda is a news app that selects the latest and best news from multiple national and international sources

News Adda A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started if thi

 Geeky.dev 7 Apr 22, 2022
A discord bot, made with Dart, which lets you run your own pure Dart code snippets directly via a discord ping, and get the output in an instant.

A discord bot, made with Dart, which lets you run your own pure Dart code snippets directly via a discord ping, and get the output in an instant.

Anikate De 3 Oct 21, 2022
Routinger is a task scheduler app that is made to make you a better person at no extra cost. The code is open-source. Dart language and Flutter framework are used extensively.

Routinger This is a simple app that will allow you to schedule your tasks, create a simple to-do, and also make recurring tasks. The app ends you noti

Routinger 16 Dec 17, 2022