Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

Hydrocarbons

Program to name a given hydrocarbon

The program takes input in the following format:

C represents a carbon atom

'-' Represents a single bond between 2 carbon atoms

'=' Represents a double bond

'#' Represents a triple bond

Brackets represent a branch on the given carbon atom

Hydrogen atoms should not be mentioned in input. Also, it is assumed that the first carbon atom (which is added automatically and should not be mentioned in the input) is a part of the longest chain.

The program finds the longest chain of carbon atoms, and provides a suitable name for the hydrocarbon, based on IUPAC naming conventions.

Sample input:

C-C(C)-C represents 2-methyl butane

!structure of 2-methyl butane

About

Program to name a given hydrocarbon

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages